Ready to get started?Download WordPress


Remove wp_get_archives from header of default templates

  1. gloddy

    On blogs with a long history, wp_get_archives in your header can lead to a lot of output, populating your header with one of these after the other?
    <link rel='archives' title='January 2009' href='' />

    I understand what it is. The question is, is anyone actually making use of it, or should it be dropped? Browsers don't seem to notice it and I can't find evidence that the search engines care about it either and it can add a great deal of heft to each page.

    Posted: 5 years ago #
  2. Tom Belknap



    You should note that it is entirely possible to either eliminate or else limit the output of wp_get_archives. There is a limit parameter to the function, or else just get rid of it altogether.

    But what the usefulness of this function is probably should be looked at. You are right about that.

    Posted: 4 years ago #
  3. FWIW, I just had an issue with my host about this. They 403/disabled my site briefly today because of heavy traffic, and told me they had been having issues with traffic load. That was surprising to me (I'm not that popular, grin). Here's what we finally figured out:

    From my hosting co. customer support:

    "Note that we have noted your site causing server load issues on many occasions as a result of your WordPress installation which has a history of not scaling well when heavy traffic hits it.

    "One theory is the Achive links that WordPress adds to your header, if you view the source of your index file you will see a large number of lines of code starting with:
    link rel='archives'

    "When we see loading issues with your site many times there are a large number of hits for proxy server IPs and the theory is that these proxies are cacheing your site and hitting all of those archive links. Many of the IPs we see when your site is causing loading issues are corporate, educational and Gov't/Military proxy IPs which appear to prefetch content when someone accesses a site.

    We would recommend removing those archive links and investigating modifying WordPress to not add those back (or additional as time goes on)."

    I checked the source and they were right -- 7 years of monthly archive links being fetched....

    I removed wp_get_archives from the header and it all seems fine now. But thought it might be of interest to others in this community.

    Posted: 4 years ago #
  4. Robert Chapin


    I'm in favor of removing that "feature". AFAIK it accomplishes nothing but slowing down the page output. I don't think it should even be in the WP core. It could be a very simple plugin.

    Posted: 4 years ago #
  5. digipham

    As you can see the code here:
    <title> <?php simple_title('-'); ?> <?php bloginfo('name'); ?> </title>
    <div id="mainContainer">

    <div id="header"></div>
    When it is done. Will look like this.

    Posted: 2 years ago #
  6. WordPress header template, replacing the relevant pieces of existing code with your own. Keep in mind that this header.php file represents what will be at the top of every page of your new WordPress theme (unless you specify otherwise).

    Posted: 2 years ago #
  7. Jam Viet

    so userful ! thansk all !

    Posted: 2 years ago #
  8. M61gger

    I think this feature already removed in recent versions..

    Posted: 1 year ago #
  9. ndhn

    To remove wp_get_archives, delete this line from header.php:
    <?php wp_get_archives('type=monthly&format=link'); ?>

    Posted: 1 week ago #
  10. Thank you for helpful advices! Everything is works now!

    Posted: 8 hours ago #

RSS feed for this topic


You must log in to post.

  • Rating

    9 Votes
  • Status

    This idea is under consideration