Top

Daily Tip: How to Find the Absolute Path to Your WordPress Root Directory

November 22, 2011

There a times when working with WordPress that you may need to locate the path to your root folder. If it’s not immediately obvious to you, here’s a way that you can locate it quickly.

Step 1: Create a new file called absolutepath.php and add the following to it:

<?php
 $p = getcwd();
 echo $p;
 ?>

Step 2: Upload the file to the folder where you have WordPress, typically public_html or httpdocs or something similar.

Now, visit http://yoursite.com/absolutepath.php to find the information you’re looking for.

Here’s an example of the output from one of my test sites:

C:\Users\Pollyplummer\Desktop\DevSites\www.playground.dev

Now you have the absolute path to your root directory. Make sure to delete the file once you’re done using it.

Comments

One Response to “Daily Tip: How to Find the Absolute Path to Your WordPress Root Directory”

  1. Mark J on November 22nd, 2011 6:01 pm

    Great Post .. I got find out my root

Got something to say?

Bottom
Article Archive  |  This site is a historical archive of pressography.com, a WordPress plugin and theme blog that published between 2006 and 2012. It is preserved for reference and is not operated by, affiliated with, or endorsed by its original authors. Nothing here is for sale and no form on this site is active. If you are the original owner and would like this domain returned, please get in touch.