WordPress.org

Ready to get started?Download WordPress

Forums

remove link elements in header.php? (4 posts)

  1. AjayTCT
    Member
    Posted 4 years ago #

    Hey guys,

    I am trying to speed up my wordpress blog by removing non-essential stuff. With regards to my header.php, there are 4 link elements -

    <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?>RSS Feed" href="<?php bloginfo('rss2_url'); ?>"></link>
    	<link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/print.css" type="text/css" media="print"></link>
    	<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>"></link>
    	<link rel="shortcut icon" href="<?php echo bloginfo('stylesheet_directory') ?>/images/favicon.ico"></link>

    That's 4 extra calls to the database and I was wondering if I could replace/delete some or all of these. Any advice?

  2. Adam Harley
    Member
    Posted 4 years ago #

    WordPress caches data in memory, so those are probably just calls to memory rather than the database.

    The first line says where to find your RSS feed.
    Second says where to find your CSS (stylesheet), don't delete that ever.
    Third says where to send pingbacks (if someone mentions your blog).
    Forth says where to find the icon for your website.

  3. AjayTCT
    Member
    Posted 4 years ago #

    Thanks for the reply. I read this article and thought I should clean up my header.php, but now wordpress just hits the memory cache instead of the DB?

  4. Adam Harley
    Member
    Posted 4 years ago #

    Okay, I just checked the code involved with loading at least the core options and essentially, any options that are marked in the database as 'autoload' will be loaded automatically anyway (in one query). If it's not been autoloaded, WP checks if it's been called before and cached, and if that's not the case, then it'll do a query to get it.

    I just had a quick peek at a pretty standard WP install too and almost all options are marked as autoload too, so I think that article is a bit... silly. It probably is hitting the memory cache most of the time, which might explain why WP is so RAM heavy sometimes!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.