WordPress

How to Find Root Directory of WordPress Website & Upload Files

Don’t worry if you don’t know how to find the root directory of the WordPress website. We will guide you throughout the finding and uploading file process.

While working on your websites, you may encounter the need to access what is referred to as the root directory, root folder, document root, or some other alternative.

The following article contains instructions on how you can view/access this folder.

If you are managing the technical work of your website then a lot of time you heard these two terms…

Upload file to the root directory of your website” or “Upload file to the public_htmlfolder.

Well, both these terms have the same meaning and refer to doing the same thing.

What is the Root Directory?

Root directory means the folder which contains all the files of software (like a window, C-drive is the root drive of the window).

Public_html, if you working on a server (hosting) then the root directory refers to a public_html folder (we can say, it’s a C-drive of the Cpanel, where all installed files of the WordPress are stored).

It does not matter which taxonomy “Upload file to the root directory of your website” or “Upload file to the public_html folder” you are using to upload a file.

In a computer file system that is organized as a pyramid or tree, the root directory is the directory that includes all other directories. (Unlike a real tree, a hierarchy file system has only one root!) In UNIX-based as well as in other operating systems, the root directory has no name. It is simply characterized by the special character that separates directories in a file system.

If you need to upload files to the server, then you have to find the root directory first and that’s what we are exactly going to do in this article.

The Primary purpose of this article is to explore the way to,

  1. How to find the root directory of a WordPress website.
  2. How To upload the file to the public_html folder.

So, let’s start.

Find the Root Directory of Hitechwork – Easy 4 Steps

Here, we find the root directory of my hitechwork website to visualize it. Please follow the below steps.

  • Login to your Cpanel and open your File_Manager.
find root directory of wordpress website in cpanel
find the root directory

Note: Hitechwork.com is my primary domain, so the root directory of hitechwork.com is “public_html” by default.

As I told you, all the new domains or subdomains, you will add in the Cpanel, will be added, under the public_html folder.

  • Have a look at the below screenshot.

find root directory of addon domain

find the root directory of the addon domain Note: You can also install WordPress into the subdirectory WordPressduring installation.

If you are not sure about the root directory of the addon domain then you can also check it by;

  • Login to your Cpanel and click on “Addon”.
addon domain option in cpanel
addon domain option

Note: Addon domain is an additional domain that you host on the same server.

  •  Here you can see all addon domains and their root directory except your Primary domain.

addon domain root directory find in cpanel

addon domain root directory finds in Cpanel

Addon domain root directory you can also edit the path or redirect website A to website B if you want.

Quick table guide to understanding Document Root Structure

Domain typeURL pathFile Structure
Main domainhttp://example.compublic_html
Subdomainhttp://store.example.compublic_html/store
Addon domainhttp://example2.compublic_html/example2.com

In this way, you can find the root directory of the WordPress website.

So, let’s move to our next step.

How To Upload File to The Root Directory Of Website

There are a lot of methods to upload the file to the root directory, for example by using the FTP account, From Cpanel, or From inside WordPress.

Below is some case when you need to upload the file to the root directory.

  1. When you have to Upload an XML sitemap file to WordPress
  2. You have to Upload the robots.txt file to WordPress
  3. When you have to verify a website with an HTML file Upload method
  4. Or have to verify third-party services like Zoho mail, mailer lite, MailChimp, etc.

To upload a file, click on File_Manager in the Cpanel and find the root directory where you want to upload the file.

Uploading the File to the Root of Primary Domain – Easy 4 Steps

Here I’m going to upload the file to the root of my primary domain. Please follow the given steps:

  • Select the root directory and click on upload.
upload file to root folder
upload file to the root folder

When you click on upload a new window will be open with the upload option.

  • Select the file that you want to upload and hit the submit button.
select upload file to upload in cpanel
select upload file

It’s done. your file is in the root folder. If you are using WordPress then you can use a plugin called File Manager. But sometimes this plugin does not work because your hosting is not allowed to upload files due to security reasons. Here’s how to make it work.

  • Install and active File Manager Plugin on WordPress.
  • Click on File Manager, Select the root directory and upload the file.

upload file using plugin

upload file using the plugin

If you don’t have access to Cpanel and this method does not work then you can use the FTP account method. To get the login detail of the FTP account, contact your hosting provider. We also discussed a method to upload files to the WordPress root directory using FTP.

Use FTP To Upload Files To The WordPress Root Directory

There are others methods of how to upload files to WordPress. In this section, I will guide you to upload files using FTP localhost. Using the FTP protocol you can easily manage, upload, download, and delete or edit any file in your WordPress root directory. We are using this Protocol because FTP enables files to be downloaded or uploaded between computers.

But, to do that you need to install the FTP client software on your computer. There is various software available for this purpose like FileZilla, WinSCP, and CyberDuck. I will guide you to the method using FileZilla. To use FileZilla, please make sure you have a Bluehost subscription, and carefully follow the steps in this FileZilla tutorial.

Use cPanel to Upload Files to the WordPress Root Directory

cPanel is the most common way to access your WordPress directory files. Normally, it is accessed from the Control Panel of the Web Hosting Provider. Through it, you manage your site easily.

Firstly, you need to log into your cPanel account. You can do it by typing in the following URL in the address bar: www.example.com/cpanel. Yes, of course, you should use your actual domain in place of ‘example.com.’ Once you have done this, you will see a login prompt. All you need to do is enter your username and password.

After successfully logging in, click on ‘File Manager. From here, you’ll be able to access all the files associated with your website, whether they were installed or used. There are files in the public_html folder associated with every WordPress root directory.

In addition, you will gain access to the WordPress core files, such as wp-config.php, and the core features of your installed Themes and Plugins. Typically from this location, people increase their PHP Memory Limit and make significant changes to the site.

It’s important to understand that Plugins and Themes files are stored in the ‘wp-content’ folder located under the ‘public_html’ folder. Those of you who are coding geeks can simply customize the functionality by modifying the code.

How to Connect FileZilla to WordPress

Connecting your FileZilla to WordPress can be easily done in a FEW STEPS and You’d be done to get on the next step. This was the easiest way found on the internet. Rather than reading all those long-ass articles. Here’s Your Solution!

FAQ’s

Ques 1: Is Public_html the root directory?

Ans: Yes, the public_html folder is the webroot for your primary domain name. This webroot means that public_html is where you put all website files that should appear when a visitor enters your primary domain name (the one you specified when you signed up for hosting).

Ques 2: How do you get to the root directory?

Ans: You can get the root directory easily by using the following steps. Please read below.

  • Type “cd/” at the DOS prompt
  • Then tap enter to switch DOS to the root directory of the current drive.
  • Now, enter the drive letter followed by a colon and press “Enter” to switch to the root directory of another drive if desired.”

Ques 3: What is a website root directory?

Ans: The root directory is also known as the document, web, and site root directory. It is the publicly accessible base folder of a website. This folder contains the index file (index.php, Html, and more), often named www or wwwroot.

Conclusion

The article will guide you through all the information about finding the root directory of a website and how to upload files to the root directory of a website. In conclusion, the root directory means containing all the software files like a window, and the C-drive which is the root drive of the window. And many methods are available to upload the file to the root directory by using the FTP account and more. I hope this article will be helpful for you to find and upload root directories.

Recommended More:

Remember to share this post with anyone who might benefit from this information, including your Facebook friends, Twitter followers, and members of your Google+ group!

Also Support Us by Liking Our Facebook, Twitter, and Google+ Page.

Leave a Comment