How To Upload WordPress Website From Localhost To cPanel


It can help you to speed up your website's process by developing your WordPress website on a live server. Because it allows you to create a customize WordPress website with a lot of features. So, here we are showing you how you can upload your WordPress website from localhost to cPanel?

As we all know that there are a couple of plugins available in this blogging world which can make this process so easy. But it's always an advantageous to do everything manually. So, take this advantage and learn it how to upload website into cPanel. Through this guide you will be able to migrate all your content like – posts, pages, images, themes and also plugins from local server to cPanel.

7 Steps To Upload Your Site From Localhost To cPanel

So, take a look list of 7 steps of uploading the WordPress website from localhost to cPanel. 

How To Upload WordPress Website From Localhost To cPanel

Upload WordPress Website From Localhost To cPanel

Step 1: Export Your Local Site Databases

Firstly, you have to create your local site database. And you have go to http://localhost/phpmyadmin/ and click on the Export button at the top menu bar.

You should choose custom option that will provide you many more options to export your database.

You have to select all tables and zipped for compression. Scroll down to the bottom of the page and press the Go button to download your database.

Step 2: Upload The WordPress Files Into Your cPanel

You have to open an FTP client & connect to your live server. When you are connect with your cPanel, you have to sure about the files would be uploaded on the right directory. Like – If you want the site will be hosted on your sitename.com then you want to upload all files in your public_html directory.

So, select all your files and upload them into your cPanel.

Step 3: Generate The MySQL Database On cPanel

Firstly, log in to your cPanel dashboard and then click on the MySQL databases icon that can be found in the section of database.

There will be open a new window in which you have to create a database through enter the name of your database.

When you create the database of your server then you scroll down to your MySQL user section and add an existing user into that database. After adding the user into your database, the cPanel will bring you to set the MySQL privileges. You just grant all of the privileges to the user.

Step 4: Insert The WordPress Database On Live Server/cPanel:

It's time to insert your WordPress database into your cPanel. Now you have to open your cPanel dashboard then scroll down to the databases section and click on phpMyAdmin.

Here you can see the phpMyAdmin where you have to click on the database that you created earlier. And phpMyAdmin will show you the new database with no tables. Simply, follow these steps to complete your process of importing WordPress database: Click on the import tab at the top menu.

  • Click on choose file button on the import page.
  • Now, select the zipped database file that you saved in Step 1.
  • At last, press the Go button which could be available at the bottom of the page.
  • Now phpMYAdmin will import your WordPress databse.

Step 5: Change Your Site URL

This is the time when you need to change your site's URL by which you can setup your WordPress cPanel. In your phpMyAdmin there will be a table of wp_options in your database which we were just included in Step 4.

And if you changed your database prefix then might be you can use the {prefix}_options.

So, you have to click on the browse button which would be next to the wp_options to open the page with the list of fields within the wp_options table. 

You can see there were a field of options_name in which an option available under that field which is site url.

You have to click on edit button which could be found in the beginning on that same row. When you click on edit button there will be open an window. You can see there your local site's URL in the input box of option_value which could be see like this: http://localhost/test. So, change your WordPress site URL and insert that URL in this field like: http://abc.com. And do it carefully!

Save the field by clicking the Go button. Similarly, you can update your home page URL like the site URL.

Step 6: Setup Your cPanel

After importing the database and uploading all of the content, now it's time to configure your WordPress. At this time, your site should be displaying an error which is Establishing The Database Connection. To solve this error you should follow these steps which are given below:

  • Connect your website by using an FTP client.
  • Now, edit the wp-config.php file.
  • Provide the name of your database, user and password that you were created in Step 3.
  • Save the wp-config.php file.
  • Upload it back to your server.
  • Visit your website & it should be live now.
  • Then login to your WordPress admin panel.
  • Go to Settings - General.
  • Click on save Options
  • Then go to Settings » Permalink and click on Save to make sure that all of the links of your post are working fine.

Step 7: Fix The Images & Broken Links

When you are uploading your website from local host to server then you will face the issues of broken links and removing images. Then you will try to solve this issue. Either you use the SQL query or use the Velvet Blues WordPress Plugin.

If you want to do solve this through SQL then you have to solve the simple SQL query by which you can solve this problem.

Firstly, you have to go on phpMyAdmin and click on your database then click on SQL from top menu. And write this query but make sure to change it with your own local and live site’s URLs.

UPDATE wp_posts SET post_content = REPLACE(post_content, ‘localhost/test/’ , ‘www.yourlivesite.com/’);

Final Words:

That's it! Your site will be uploaded on cPanel that will be running live now. And you can check your site now either it works properly or not.

If you find any kind of problem then you can leave us a comment in our comment box and we will surely to help you out.

Comments 10

  1. Thank you for this. I appreciate the step by step. I know this is super helpful. I love your visual too!

  2. These are great tips for those that need help with their website, you broke it down so simple and easy for people understand.

  3. we were self hosted on wordpress from the beginning so we didn’t have to worry about this. However, this will be useful to a lot of bloggers! x corinne

  4. Thank you so much for this, I’ve always wondered how to do this myself, next time it needs doing I am going to give it a whirl myself.

  5. I love that this is so easy to follow. I am definitely always looking to improve my site. I love having my pages load speedy.

  6. This is so helpful, thank you! I am horrible with techy stuff so posts like this help me a lot.

  7. Gone are those days I upload WordPress from localhost to cPanel. Nowadays, I work directly from my backend.

  8. I really wish I had seen this before I went self-hosting. I probably would have saved myself a good deal of money. Thanks for the great information for future ideas.

  9. This tutorial is very helpful. Easy to follow steps. I always read tutorials on how to do technical stuff.

Leave a Reply

Your email address will not be published. Required fields are marked *

How To Upload WordPress Website From Localhost To cPanel

log in

Become a part of our community!

reset password

Back to
log in
Choose A Format
Personality quiz
Trivia quiz
Poll
Story
List
Meme
Video
Audio
Image