LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices


Reply
  Search this Thread
Old 10-25-2019, 06:40 AM   #1
mikudo
Member
 
Registered: Aug 2018
Posts: 82

Rep: Reputation: Disabled
how to remove wordpress theme's google API calls


I am running my static site with a very basic wordpress theme.

It is based on the wordpress service, where somehow my hosting space is part of the wordpress cloud, I get pushed out updates, which I don't like and is stupid but whatever.

I see that whenever someone goes to my site it loads google apis, I think this is from the theme. I am wondering if I can just cut those out of the code without breaking things.

Why does a static page wordpress theme need a google api if not for tracking features? I figure at least.

jmichaelhudson.net is my site.

Ideally yeah I would do it all myself, maybe if I were somehow stronger and more stoic, but I need me site for it to be primarly about the words right now.

Also, the stuff I am writing is about some important stuff you may not find elsewhere, you should consider it.

tia
 
Old 10-25-2019, 10:36 AM   #2
dogpatch
Member
 
Registered: Nov 2005
Location: Central America
Distribution: Mepis, Android
Posts: 490
Blog Entries: 4

Rep: Reputation: 238Reputation: 238Reputation: 238
Am not a wordpress expert, but know wp relies heavily upon php. Some questions for you:

Do you have your wordpress system on your local hard drive, and can you do sftp uploads? Have you any familiarity w/ php scripting? (Or, at least, the capability of learning php via online examples.)

If yes to the above, find the themes folder, and open the script that contains the Google API call. (I assume you are using wp's default settings, so your theme will be the default one.) BACK UP THE FILE, then edit out the offensive code. Upload via sftp, and see if you've done what you intend. Be prepared for some trial-and-error, backtracking, and restoring of backups.

Alternatively, your site is static, and quite simple. You may want to just write your own static html pages, and forget wordpress. If you want help with that, i might be available.

BTW, i like your site. Have borrowed your Orwell quote for my own quote jar. Hope you don't mind.
 
Old 10-25-2019, 10:40 AM   #3
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Quote:
Originally Posted by mikudo View Post
I see that whenever someone goes to my site it loads google apis, I think this is from the theme. I am wondering if I can just cut those out of the code without breaking things.
It's an API to make use of non-standard fonts. So you can take it out but it may break your presentation.
 
Old 10-25-2019, 10:58 AM   #4
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
I can't process, visually, the orange-on-black pages. Much too hard on the eyes.
Yes, that's just my opinion, and what little I read looked interesting, but...

That said, I have to agree that if the site is static, don't use WordPress at all, if you can. Way too much overhead, IMO.
 
Old 10-25-2019, 10:59 AM   #5
dogpatch
Member
 
Registered: Nov 2005
Location: Central America
Distribution: Mepis, Android
Posts: 490
Blog Entries: 4

Rep: Reputation: 238Reputation: 238Reputation: 238
On one of my old wordpress systems, the script in question was in the folder:

wp-content/themes/default/

and was named 'header.php'

TenTenths may be right, but imho its worth a shot to comment out the php line that produces
Code:
<link rel='dns-prefetch' href='//fonts.googleapis.com' />
and see what you get. You can always retsore the line if removing it breaks your presentation.

That's the beauty of wordpress. You have the php code, so you can customize as much as you want w/ or w/o wordpress's generated code.
 
Old 10-25-2019, 12:14 PM   #6
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,222

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Quote:
Originally Posted by TenTenths View Post
It's an API to make use of non-standard fonts. So you can take it out but it may break your presentation.
You can host the fonts yourself.
 
Old 10-25-2019, 03:01 PM   #7
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by mikudo View Post
jmichaelhudson.net is my site.
Looking at the source, there's links to fonts.googleapis.com and fonts.gstatic.com. All 3 are in the header section.
This means that they are most likely coded into the (default) page template of that theme. That's where you have to go.

PS: wordpress is total overkill for a simple static site.
 
Old 10-26-2019, 09:26 AM   #8
mikudo
Member
 
Registered: Aug 2018
Posts: 82

Original Poster
Rep: Reputation: Disabled
Thanks guys this is helpful, I will let you know how it goes.

As for the guy who was turned off by my sites colors, can't please everybody.

I very frequently copy text from a site I find difficult to read into leafpad or something.

The important thing is conveyance of text, and yes I do hope some day fairly soon to step up and do it all myself with raw html, but I have to admit also that wordpress did cut the time of putting up a lot of content quite a bit. Of course, you have to know not to install any of the social media or fancy plugins or you will be the proud member of a bot net.

Thanks, Ill leave open for now and report back.
 
Old 10-26-2019, 09:49 AM   #9
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Quote:
Originally Posted by mikudo View Post
Thanks guys this is helpful, I will let you know how it goes.

As for the guy who was turned off by my sites colors, can't please everybody.

I very frequently copy text from a site I find difficult to read into leafpad or something.

The important thing is conveyance of text, and yes I do hope some day fairly soon to step up and do it all myself with raw html, but I have to admit also that wordpress did cut the time of putting up a lot of content quite a bit. Of course, you have to know not to install any of the social media or fancy plugins or you will be the proud member of a bot net.

Thanks, Ill leave open for now and report back.
If “The important thing is conveyance of text,” then one should try to please everybody.
My comment wasn’t about being “pleased,” it was that, in my case, the color theme was physically too difficult to read. It wasn’t an opinion...I was advising you of a fact. Thank you for the suggestion for working around the bad design, but I’ll pass.

It is, of course, your site to do with as you wish. Good luck.
 
Old 11-03-2019, 09:09 AM   #10
mikudo
Member
 
Registered: Aug 2018
Posts: 82

Original Poster
Rep: Reputation: Disabled
I looked through all of the php files I had access to through the normal interface, they must be buried somewhere in other linked files. ctrl-f found no google in header.php. Ill go to the wordpress forums this is not a lq but you guys were helpful.

Ideally, Sean, I would like a dropdown in the upper right where background and text color could be changed to several hundred presets or customized on every single page of the internet.

How hard could that be? Or it is just a browser add on?

What are the most universally accepted text/background colors in your opinion? Maybe I will just like those better myself anyway?

I also wonder though if there is anything more subjective as what text color one wants to read in.

I know I seemed dismissive but I am actually very open to new ideas on this topic.
 
Old 11-03-2019, 11:03 AM   #11
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Quote:
Originally Posted by mikudo View Post
I looked through all of the php files I had access to through the normal interface, they must be buried somewhere in other linked files. ctrl-f found no google in header.php. Ill go to the wordpress forums this is not a lq but you guys were helpful.

Ideally, Sean, I would like a dropdown in the upper right where background and text color could be changed to several hundred presets or customized on every single page of the internet.

How hard could that be? Or it is just a browser add on?

What are the most universally accepted text/background colors in your opinion? Maybe I will just like those better myself anyway?

I also wonder though if there is anything more subjective as what text color one wants to read in.

I know I seemed dismissive but I am actually very open to new ideas on this topic.
What you suggest about allowing visitors to select colors would be a reasonably complex (because of the "several hundred presets") javascript or server-side scripting to manipulate/change the CSS for a page.

In my opinion, the best colors to use are black on white, although, as you can see here, black on most any pale background (LQ uses tan and a light blue) can work as well. I was recently told by a UX expert that the current trend to "dark mode" in mobile devices was actually much harder on the user's vision. That's my 2 cents.

There are probably considerable discussions available on line.
 
Old 11-04-2019, 02:01 AM   #12
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by ondoho View Post
Looking at the source, there's links to fonts.googleapis.com and fonts.gstatic.com. All 3 are in the header section.
This means that they are most likely coded into the (default) page template of that theme. That's where you have to go.
Quote:
Originally Posted by mikudo View Post
I looked through all of the php files I had access to through the normal interface, they must be buried somewhere in other linked files. ctrl-f found no google in header.php.
header.php sounds good. It probably includes more stuff via if statements or some such. Take a look inside.

If not, you can still grep for it:
Code:
grep -E 'gstatic|google' -r
PS: what's "the normal interface"?
 
Old 11-07-2019, 06:38 AM   #13
mikudo
Member
 
Registered: Aug 2018
Posts: 82

Original Poster
Rep: Reputation: Disabled
Normal interface is a bad way to say the wordpress admin menu which includes a 'theme editor' where you can edit the files.

New information, ctrl+f on the page does not search the code. If you click the code, a txt window pops up that says 'use /re/ syntax for regex search' but whatever I type in there doesn't work. I tried several combinations and nothing would search the code, any ideas what would actually search text here?

But I did manually look over header.php and I did not see any gorgle crap. But I think it does have to be in some of these files. There was a link to this which I found interesting and not alarming, https://gmpg.org

@scasey: I would rather die than spend the rest of my life looking at black text on white background. The light should contain the information, not the absence thereof. A white screen with some black words on it is putting out energy and light to express blank space, which I also find from a general engineering perspective so backwards it makes my eyes twitch just thinking about it. Black to express blankness is what is to me logical and good on the eyes. But it really just has to be darkish, dark greens and blues also look nice.

Imagine if you went back to the green text crt days and told the engineer that you thought the background should be green and omitting the green to make black letters, that is what you are saying is the right way. I thought you would have some interesting pallets to suggest, but to sit here all day like some intern in msword staring at blinding whitespace all day is out of the question.

There are lots of ways to hurt your eyes with dark contrast themes as well, like I have written about extensively also here at LQ, management is always looking for a one size solution for their low budget office, while every single human has slightly different lighting needs, and it is a very personal decision what colors you want to stare at for 8 hours a day. This illustrates problems with an authoritarian and hierarchical economic model that threaten what we know as the 'personal' computer.
 
Old 11-27-2019, 09:33 AM   #14
mikudo
Member
 
Registered: Aug 2018
Posts: 82

Original Poster
Rep: Reputation: Disabled
Update.

Ok I downloaded my site, I have the full vhosts file and so I can search all code. I had to set up stuff I was trying to not have to set up, out of laziness and wanting to focus on content. It is also like learning a specific provider's setup.

I realized that for some reason the theme editor's search feature just doesn't work, maybe with my browser, so it was returning negative hits on searches for strings that were actually there. Nor does it let you search with browser, the code is in a special window that doesn't search, which was all misleading and threw me off.

With my full site I was able to search exactly where you guys said, the wp-content/ folder with

grep -rnw wp-content/ -e 'googleapis' | more

and

grep -rnw wp-content/ -e 'fonts.google' | more

And tada, there were two lines in the twenty-sixteen theme. Now commented out, now no google loads, site not affected. I suspect something might break if I tried to use different theme fonts but who cares about that.

And now everyone else who asks the same question will know just what to do I hope.

Thanks lq folk, topic solved.
 
Old 11-28-2019, 01:15 AM   #15
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by mikudo View Post
grep -rnw wp-content/ -e 'fonts.google' | more

And tada, there were two lines in the twenty-sixteen theme. Now commented out, now no google loads, site not affected. I suspect something might break if I tried to use different theme fonts but who cares about that.
Great.
FWIW, I'd actually remove the lines because commented they still get loaded by your clients (the lines, not the fonts) and possibly bots and crawlers too.
About fonts: IMO, one should only use the generic (system independent) font names serif, sans-serif, monospace (there's one or two more I don't remember now).
Anything beyond that - cleverly created font definitions that try to account for every possible use case - is just web designers faffing around.
 
  


Reply

Tags
api, google, wordpress



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How To Install WordPress Theme And Find Best Theme To Suit Your Needs LXer Syndicated Linux News 0 12-07-2015 06:41 AM
how does java calls the system calls which are written in c babu198649 Linux - General 3 12-05-2011 03:40 AM
LXer: Atolm GTK Theme + Clarity Icon Theme = Perfect for Dark Theme Fans LXer Syndicated Linux News 0 02-26-2011 11:50 PM
openoffice force default theme / no theme | dark theme fix H_TeXMeX_H LinuxQuestions.org Member Success Stories 1 03-08-2010 12:56 PM
LXer: Understanding WordPress Theme: The Basics of Creating Your Own WP Theme LXer Syndicated Linux News 0 01-08-2010 12:20 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > General

All times are GMT -5. The time now is 10:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration