• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
NameHero Blog

NameHero Blog

Web Hosting Tips & Resources From NameHero

  • Hosting
    • Web Hosting
    • VPS Hosting
    • WordPress Hosting
    • WooCommerce Hosting
  • Reseller
  • Enterprise
  • Domains
  • Account
  • Blog Home
  • Categories

How To Change Your WordPress URL In The Database

Ryan Gray

Published on: October 16, 2018

Categories: WordPress 3

We frequently get tickets asking us to change the location of WordPress.

If you’re using the Softaculous auto installer it’s not hard to accidentally install WordPress in the /wp folder as that’s the default location.

Some people will simply delete the install and re-install leaving that parameter out:

If that’s not an option for you (i.e. you didn’t use Softaculous to install or you don’t want to remove it) there is a very easy fix to move WordPress.

Move The Location Of The Files

To get started with moving the location of your files, you simply need to login to cPanel -> File Manager:

Once inside, you’ll want to navigate to where the existing WordPress installation is.

Most of the time they’ll be somewhere inside of the public_html folder.  If you left Softaculous defaulted to /wp, they’ll  be in /public_html/wp:

To move them, you’ll click beside the top folder (wp-admin) and hold down the shift key and then click the last file in the list (notice how everything turns blue):

Once selected, you’ll drag them into the location you want, most of the time public_html.

This would look something like this:

Congratulations, at this time you’ve moved your WordPress files successfully!

How To Change The URL In The Database

Once the files are moved, you need to change the location inside the database.

This is so WordPress knows where the files are now located.

To do this, simply login to cPanel -> phpMyAdmin:

Once inside, you’ll click on your database name on the left:

As you can see, my database is called keydiets_wp123.  If you only have one database this is easy, if you have multiple, you may need to open your wp-config.php file and confirm which database you’re using (use cPanel -> File Manager).

Once you have the correct database name, you’ll notice a table called options.  You’ll select Browse beside it:

You will then see the siteurl and home in the option_name column.

Inside each of those, you’ll be able to click the URL and modify it accordingly.

When you click out, it’ll automatically save:

Once your URLs are set correctly, you’re finished:

Congratulations!  Your files have been moved and your new URLs are set!

Generate A New .htaccess File

Finally, you need to have WordPress generate a fresh .htaccess file to ensure it picks up the changes.

To do this, simply navigate to your wp-admin and login (i.e. https://yourwebsite.com/wp-admin).

From the dashboard, hover over Settings -> Permalinks:

Once here, simply click Save Changes and it’ll automatically generate:

Congratulations!  You’ve successfully changed your WordPress URL from inside the database!

How To Change Your WordPress URL

I’ve filmed a video tutorial where I walk through these steps for those that wish to follow-along:

Feel free to reach out to our Superhero Support team if you have any questions!

Ryan Gray
Ryan Gray

Ryan Gray is the founder and CEO of NameHero, one of the fastest growing independent web hosts in the United States. Ryan has been working online since 1998 and has over two-decades experience in Internet Entrepreneurship.

Reader Interactions

Comments

  1. Sherman Sweeney says

    September 25, 2019 at 8:51 am

    Thank You, Mr. Ryan, It’s nice to watch a video and learn at the same time, At least I can do the work for me, and Customer. Thank You Very much and your Team I love Namehero. Someday I go and Visit everyone also bring Pizza.

    Reply
  2. Betsy says

    May 20, 2021 at 3:16 pm

    Thank you for another helpful how-to article, Ryan & NameHero Team! I’ve been so impressed with your tutorials and knowledgebase. So glad I moved to NameHero!

    Reply
    • Ryan Gray says

      May 24, 2021 at 12:12 pm

      You are most welcome! Thank you for your business!

      Reply

Leave a Reply Cancel reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Follow & Subscribe

Exclusive promos, content and more!

Most Popular Posts

Speed up your site: solving the WordPress slowdown

NameHero’s Recommended WordPress Plugin and Theme Setup (2023)

How To Increase The InnoDB Buffer Pool Size

How To Fix A Stuck All-in-One WP Migration Import

How To Add A Subdomain In Cloudflare

Top Categories

  • WordPress
  • Website Performance
  • Web Hosting
  • Resellers
  • Website Development
  • Website Security
  • VPS Hosting
  • SEO Tips
  • Announcements
  • Domain Registration
NameHero

NameHero proudly provides web hosting to over 40,000 customers with 99.9% uptime to over 750,000 websites.

  • Master Card
  • Visa
  • American Express
  • Discover
  • Paypal
Products
  • Web Hosting
  • VPS Hosting
  • WordPress Hosting
  • WooCommerce Hosting
  • Reseller Hosting
  • Enterprise Hosting
  • Domains
Help & Support
  • NameHero Blog
  • Knowledgebase
  • Announcements
  • Affiliates
Company
  • About Us
  • Contact Sales
  • Reviews
  • Uptime
  • We're Hiring

Copyright © 2023 NameHero, LLC. All rights reserved.

  • Privacy Policy
  • Terms of Use
  • Acceptable Use Policy
  • Payment Policy
  • DMCA