{"id":64800,"date":"2011-11-22T16:14:44","date_gmt":"2011-11-22T21:14:44","guid":{"rendered":"http:\/\/wpmu.org\/?p=64800"},"modified":"2022-04-08T05:41:11","modified_gmt":"2022-04-08T05:41:11","slug":"daily-tip-how-to-find-the-absolute-path-to-your-wordpress-root-directory","status":"publish","type":"post","link":"https:\/\/wpmudev.com\/blog\/daily-tip-how-to-find-the-absolute-path-to-your-wordpress-root-directory\/","title":{"rendered":"How to Find the Absolute Path to Your WordPress Root Directory"},"content":{"rendered":"<p>There a times when working with WordPress that you may need to locate the path to your root folder. If it&#8217;s not immediately obvious to you, here&#8217;s a way that you can locate it quickly.<\/p>\n<p><b>Step 1: Create a new file called absolutepath.php and add the following to it:<\/b><\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\n$p = getcwd();\r\necho $p;\r\n?&gt;\r\n\r\n<\/pre>\n<p><b>Step 2: Upload the file to the folder where you have WordPress, typically public_html or httpdocs or something similar.<\/b><\/p>\n<p>Now, visit <em>http:\/\/yoursite.com\/absolutepath.php<\/em> to find the information you&#8217;re looking for.<\/p>\n<p><strong>Here&#8217;s an example of the output from one of my test sites:<\/strong><\/p>\n<p><i>C:\\Users\\Pollyplummer\\Desktop\\DevSites\\www.playground.dev<\/i><\/p>\n<p>Now you have the absolute path to your root directory. Make sure to delete the file once you&#8217;re done using it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s a quick and easy way to figure out the absolute path to your root directory.<\/p>\n","protected":false},"author":4099,"featured_media":207704,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"blog_reading_time":"","wds_primary_category":0,"wds_primary_tutorials_categories":0,"footnotes":""},"categories":[263],"tags":[],"tutorials_categories":[],"class_list":["post-64800","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials"],"_links":{"self":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/64800","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/users\/4099"}],"replies":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/comments?post=64800"}],"version-history":[{"count":2,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/64800\/revisions"}],"predecessor-version":[{"id":207705,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/64800\/revisions\/207705"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media\/207704"}],"wp:attachment":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media?parent=64800"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/categories?post=64800"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tags?post=64800"},{"taxonomy":"tutorials_categories","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tutorials_categories?post=64800"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}