How to remove junk from <head> element

Hi there,

I am very new to php and I wonder if anyone could help me learn something.

I am running a WordPress site and with that come numerous plugins. Now my assumption is that each of the plugins injects some code into the element.

I also assume that what gets into the element is also specified in the header.php file through a theme. So that would mean that there are 2 ways how code lands in the element - correct?

Now I’d like to know how (and if at all) I can manually remove some of the code from there? I have reviewed the code via Google Chrome > Inspect function and see a lot of stuff I don’t need there. Is there a way to remove it manually - not through another plugin? It slows down my website terribly!

Thank you! :slight_smile:

It is very likely that if the code is there, it is for a reason. You could always modify the file and comment out what you don’t think you need and test that everything still functions however.

Thanks for your reply @astonecipher

There is a lot of unnecessary css code and other junk that is just slowing down the website.

The issue I have is that the output shows much more code that what’s in my theme’s header.php file. Hence me asking how I can manually remove what is being injected in the header (it is my assumption that some plugins inject it there?). Maybe I just don’t understand how it works and so I joined this website to learn about it :slight_smile:

That is one of the great joys of WordPress…

Sponsor our Newsletter | Privacy Policy | Terms of Service