Determining WordPress Paths and URLs

I often need to include a directory or URL path when writing a theme or plugin, but I can never find all of the different options in one place, so I’m pulling it together from various Codex pages and xref.


  • ABSPATH – /var/www/vhosts/
  • WP_CONTENT_DIR – /var/www/vhosts/
  • WP_PLUGIN_DIR – /var/www/vhosts/
  • TEMPLATEPATH – /var/www/vhosts/
  • STYLESHEETPATH – /var/www/vhosts/
  • BLOGUPLOADDIR – /var/www/vhosts/{blogid}/files/ (multisite only)

bloginfo() Parameters

  • template_directory –
  • template_url – [1]
  • stylesheet_directory –
  • stylesheet_url –

Miscellaneous Functions

  • site_url() / home_url() – [2]
  • admin_url() –

[1] You might expect bloginfo(‘template_url’) to be consistent with bloginfo(‘stylesheet_url’) and return the URL to the parent theme’s style.css. You’d be wrong. It gives you the directory, just like bloginfo(‘template_directory’)
[2]  It’s better to use these instead of bloginfo(‘url’) and bloginfo(‘wpurl’) because they’ll return an HTTPS URL when appropriate. If you’re going to be using it multiple times on a page it’s more efficient to assign it to a variable instead of calling it over and over.

One thought on “Determining WordPress Paths and URLs

  1. Hi Ian

    Thank you for this article, I had a case where bloginfo(‘url’) was breaking my code for no apparent reason, and site_url() just saved the day!

    Best Regards

Leave a Reply

Your email address will not be published. Required fields are marked *