The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other WordPress wp_head call bringing in loads of crap

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • #44980

    Just building a WP theme and I trying to create everything from scratch so I can create my own framework and also to keep things as clean as possible.

    I’ve noticed that as soon as I add the wp_head call WordPress adds a few lines of crap. It looks like most of it is for the admin bar but its inserted css into the head using the old text/css.

    Just wondered if I can stop or change this css?

    I know I can turn off the admin bar is this the only way?


    Put this in your functions.php file

    // clean head
    remove_action(‘wp_head’, ‘rsd_link’);
    remove_action(‘wp_head’, ‘wlwmanifest_link’);
    remove_action(‘wp_head’, ‘index_rel_link’);
    remove_action(‘wp_head’, ‘parent_post_rel_link’, 10, 0);
    remove_action(‘wp_head’, ‘start_post_rel_link’, 10, 0);
    remove_action(‘wp_head’, ‘adjacent_posts_rel_link_wp_head’, 10, 0);
    remove_action(‘wp_head’, ‘wp_generator’);
    // remove admin bar
    add_filter(‘show_admin_bar’, ‘__return_false’);


    Thanks, didn’t know about this.

    By the way when I added the footer call even more was added, is there a clean up for the footer too?

    Don’t mind the admin bar but I can’t cope with this amount of junk.

    One other thing, is there a way to stop WP using absolute paths to assets?


    interessting, will use it for my new theme too.


    Thanks Melindrea once again!


    I’ve been a bit of a numpty here, when I was seeing most of that junk I was logged in. Now I’ve logged out a lot of it has disappeared so most of it was the admin bar.

    Thanks again for the links though!


    In the past you had to edit WordPress core files to customize something. Now for most things there are [Hooks, Actions and Filters]( [WordPress Hooks Database]( is another great resource to have handy.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘Other’ is closed to new topics and replies.