Select Page

If you are managing technical work of your website then a lot of time you heard this two terms “Upload file to the root directory of your website” or “Upload file to the public_html folder“, I’m right. Well, both these terms have the same meaning and referring to do the same thing.

upload file to the root directory of wordpress

upload file to the root directory

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

Public_html, if you working on a server (hosting) then root directory refers to a public_html folder (we can say, its a C-drive of the Cpanel, where all installed file of the WordPress is 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. If you need to upload files to the Server, then you have to find the root directory first and that’s 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 root directory of WordPress website
  2. How To upload the file to public_html folder

So, let’s us start.

How To Find Root Directory Of WordPress Website

The root directory is the folder that stores all the files for your website and that folder name is public_html on the server (Cpanel). By default, it’s your primary domain folder.

For example, If “exmaple.com” is your primary website name then your root directory is “public_html/”

But, when you add Addon domain to your Cpanel, it will create a new folder in your “public_html” folder.

For example, Suppose I add “example2.com” in my Cpanel then “public_html/exmaple2” Is my root folder for “exmple2.com” domain.

Note: The document root for a subdomain is a bit different. If your subdomain is “abc.example.com”, then the document root folder would be “public_html/abc”.

Let’s we find the root directory of my hitechwork to visualize it.
  • Login 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 domain or subdomain, You will add in the Cpanel, it will be added, under the public_html folder.

  • Have a look at below screenshot.
find root directory of addon domain

find root directory of the addon domain

All the new domain is added in the public_html folder.

Note: You can also install WordPress into subdirectory WordPress during installation.

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

  • Login you Cpanel and click on Addon.
addon domain option in cpanel

addon domain option

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

  •  Here you can see you all addon domain and its root directory expected your Primary domain.
addon domain root directory find in cpanel

addon domain root directory find 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 type URL path File Structure
Main domain http://example.com public_html
Subdomain http://store.example.com public_html/store
Addon domain http://example2.com public_html/example2.com

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

So, let move to our next step.

How To Upload File To The Root Directory Of website

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

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

  1. When you have to Upload XML sitemap file to WordPress
  2. When you have to Upload robots.txt file to WordPress
  3. When you have to verify website with HTML file Upload method
  4. Or have to verify third-party service like zohomail, 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.

Note: Here I’m going to upload the file to the root of my primary domain.

  • 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 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. you 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 not allowed to upload files due to security reason.

 

  • 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 plugin

If you don’t have an access to Cpanel and this method do not work then you can use FTP account method. To get the login detail of FTP account, contact your hosting provider.

So, in this way, you can upload the file to the root directory of WordPress website.

Recommend Post

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.

If you have any suggestion or problem about “how to find root directory of WordPress website,” then please feel free to comment below.

Follow me

Harvinder Singh Sharry

owner at Hitechwork
I'm Professional Blogger, SEO, and Digital marketing expert. I started my blog in 2016 with the aim to share my knowledge and experiences for the people associated with my field as well as for the general public.
Follow me

Be the first to get the latest Updated WordPress Ping List.

We will send you a newly update ping list after every two months.

Confirm your Email

Pin It on Pinterest

Shares
Share This