Comments on: Remove Unnecessary Code from wp_head http://www.themelab.com/remove-code-wordpress-header/ We build High Quality, Good Looking Premium WordPress Themes that are Easy to Use and ready for just about anything. Tue, 28 Jun 2016 19:01:53 +0000 hourly 1 https://wordpress.org/?v=4.7.1 By: Matej Latin http://www.themelab.com/remove-code-wordpress-header/#comment-22331 Wed, 13 Feb 2013 11:52:39 +0000 http://www.themelab.com/?p=2274#comment-22331 I don’t know why do theme developers put these in their themes as default in the first place.

I used a very basic theme and modified it to suit my website but all these junk was still in my header (among with some other junk WordPress automatically loads).

Thanks for this post, I found it very useful.

]]>
By: Chuck Reynolds http://www.themelab.com/remove-code-wordpress-header/#comment-17910 Sat, 03 Sep 2011 06:34:39 +0000 http://www.themelab.com/?p=2274#comment-17910 Just found this post based on the adjacent_posts_rel_link_wp_head – This may work for you and your audience so I think it’s relevant… not trying to spam but…
I threw a handful of functions and cleanup type of stuff that I hope works for everybody’s installs to help clean it up and get rid of some of the crap like the wp_head stuff you’ve posted here.

the plugin, for lack of a better name, is Selfish Fresh Start… selfish because it’s the stuff I feel should be removed from every install lol.

http://wordpress.org/extend/plugins/selfish-fresh-start/

]]>
By: Bill Bennett http://www.themelab.com/remove-code-wordpress-header/#comment-15544 Thu, 09 Sep 2010 19:12:22 +0000 http://www.themelab.com/?p=2274#comment-15544 Yes, it used wp_head. Is that something I need to worry about?

]]>
By: Leland http://www.themelab.com/remove-code-wordpress-header/#comment-15542 Thu, 09 Sep 2010 15:08:43 +0000 http://www.themelab.com/?p=2274#comment-15542 Does your theme use the wp_head hook? It sounds like that “leave this for stats” bit is hardcoded into your theme’s header.php file.

]]>
By: billbennettnz http://www.themelab.com/remove-code-wordpress-header/#comment-15532 Mon, 06 Sep 2010 21:44:05 +0000 http://www.themelab.com/?p=2274#comment-15532 I don’t have any of these in my header except for the WordPress generator – in my theme this is in a comment with “leave this for stats please”

What’s that about?

]]>
By: Andrew Nacin http://www.themelab.com/remove-code-wordpress-header/#comment-15284 Fri, 06 Aug 2010 01:22:19 +0000 http://www.themelab.com/?p=2274#comment-15284 We changed its name because we modified (improved) how it works in a backwards incompatible way. Fine for core, as it is an enhancement, but if a plugin was using the original plugin the way core does, we don’t want to alter that functionality.

The new function actually just calls the old function — http://core.trac.wordpress.org/ticket/10867

]]>
By: Adam Dunford http://www.themelab.com/remove-code-wordpress-header/#comment-15197 Thu, 22 Jul 2010 13:51:56 +0000 http://www.themelab.com/?p=2274#comment-15197 Great stuff, although I should add that there’s been a little change in WP 3.0 with adjacent_posts_rel_link. It is now adjacent_posts_rel_link_wp_head (not sure why it changed).

I figured that out by going to /wp-includes/default-filters.php and reversing what was listed in the add_action section.

Any idea why that would have changed?

]]>
By: Tom http://www.themelab.com/remove-code-wordpress-header/#comment-15194 Wed, 21 Jul 2010 19:48:07 +0000 http://www.themelab.com/?p=2274#comment-15194 Hi. Do you know how I can remove jquery being called automatically? Obviously it needs to be called in the admin site, but client side, I use mootools, so don’t want two js libraries being called.

Thanks
Tom

]]>
By: Leland http://www.themelab.com/remove-code-wordpress-header/#comment-15109 Sun, 11 Jul 2010 22:46:31 +0000 http://www.themelab.com/?p=2274#comment-15109 Hey Devin, thanks for the comment. That’s a good point about plugin code. Especially when plugins like Contact Form 7 automatically load up CSS and JS on every page, when you usually only need it on one (or any page you actually have a contact form).

]]>
By: Devin http://www.themelab.com/remove-code-wordpress-header/#comment-15108 Sun, 11 Jul 2010 21:40:00 +0000 http://www.themelab.com/?p=2274#comment-15108 Excellent post Leland! The relational links always bothered me a bit but I never looked into how to remove them.

I think it’s also worth mention that a lot of the code added by plugins can also be removed: http://wptheming.com/2009/12/optimize-plug-in-script-wordpress/

]]>