WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I read an article (which I didn't save) that argued you can improve the performance of your site by changing all file paths to full paths, so for instance, instead of <img src="<?php bloginfo('template_directory'); ?>/images/headers/image.jpg" /> we go with <img src="http://domain.com/.../images/headers/image.jpg" />.

My platform has its own theme, meaning that it will only be updated if we update it. So changing paths should not be an issue. Also, the article suggested that you do the same type of changes everywhere, e.g. script files, functions.php, plugins (if you can be bothered to redo it every time they update...).

So the question is, how much performance will this improve? Surely sending less requests on a page load should make some very minor, but noticeable, improvement?

share|improve this question
up vote 5 down vote accepted

This is nonsense. Almost all URL getters are a result of get_option(), eg. get_option('stylesheet_root'), get_option('template') and so on.

These options are loaded very early during the request, they are cached and not fetched again.

Since the options are fetched anyway, all you can improve is processing time. Nanoseconds. This isn’t worth the trouble. Just compare to the time you need when you have t change something in all those files (switching to HTTPS, to a sub-domain, changing permalinks).

Install a good caching plugin. That will improve load time much, much more.

share|improve this answer
This is what I thought indeed. I thought that article was a bit out there when I read it. Let me try to Google it and see if I can link you to it. Thanks for the answer, I will accept it soon. – Christine Cooper Jan 29 '13 at 15:55
I can't seem to find that particular article, however found various articles that suggest to hardcode paths but some of their other optimisation techniques are quite ridiculous so it doesn't hold any credibility. – Christine Cooper Jan 29 '13 at 16:02
@ChristineCooper I have read that multiple times over the years. No need to generate backlinks for that. The most expensive function in WordPress is wptexturize(), not any URL getter. Disable that to get something to measure. :) – toscho Jan 29 '13 at 16:12
Indeed, thanks toscho! – Christine Cooper Jan 29 '13 at 16:19
Is wptexturize() used much or am I safe to disable it? I had a look at the codex page but it doesn't give me an overview of its importance. – Christine Cooper Jan 29 '13 at 16:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.