How to Find the Absolute Path to Your WordPress Root Directory

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:

$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 to find the information you’re looking for.

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

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

Щелкните ниже, чтобы поставить оценку!
Всего: 0 В среднем: 0

Написать комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *