How to change the WordPress URL?

Can you change your WordPress URL? The simple answer is yes. There are several ways to change your WordPress URL, and you don't have to know sophisticated programming languages.

Updated: 20 Sep, 24 by Susith Nonis 6 Min

List of content you will read in this article:

Every time you create a new page, the WordPress URL is automatically created. The good thing about WordPress page URLs is that your titles usually inspire them. You are, therefore, likely to end up with a URL that you like.

If you are not happy with your URLs, you also have the option to change them. Many website owners have edited their WordPress URLs for different reasons. While some make the changes to optimize their sites for search engines, others do it to make them more memorable and simpler. 

View URL change as a change for clothing. Here are some of the reasons you may want to make changes.

1.   To increase security

Changing your WordPress URL comes with security benefits. For instance, changing your login URL can protect you against brute force attacks. Hackers often look for your logins and passwords by landing on your login page.

In this instance, changing your website login URL will hide the page and prevent brute force attacks. 

If you have acquired an SSL certificate, then you are required to replace your website's "www" prefix with "http."

2.   Moving the site or directory

Changing your WordPress URL can help with enhancing your website hygiene. For instance, you can move a subdirectory to the main directory or move the site to a new domain. 

3.   To make your URL SEO friendly

A URL change may be necessary when looking to make it SEO-friendly. For instance, you may be required to describe the content of your page or site by adding a phrase that describes the content. You can also include keywords in the URL or add hyphens to enhance readability.

You can also change your site URLs by making them brief while at the same time descriptive. A URL change to make them more usable and readable would be good for SEO.

4.   Site makeover

Whether you have changed the name of your blog company or moved to a new domain, the makeover should be followed by a change in URL. This will ensure consistency.

There are several ways to change WordPress URL:

1.   Changing URL in the admin dashboard

One of the simplest ways to change your WordPress URL is in the admin dashboard. Here are the steps:

  1. Log into your WordPress admin dashboard
  2. Go to the "General Option."

On the left side of the menu, click on setting, then under it, select "General." Under the general settings page, then you will see the "WordPress Address (URL)" and "Site Address (URL)" fields.

Populate the new address in the fields. Unless you give WordPress its directory, the two fields should match. After keying in the new address, scroll down and save the changes.

Moving forward, you will be able to visit your WordPress site using the new address.

2.   Changing the URL in the database

The other method of changing your WordPress URL is directly in the database through phpMyAdmin, which can be accessed through the dashboard in cPanel. However, with this method, you need to be extra careful not to break your site.

  • Click on your database

On the left side in phpMyAdmin, select your database.

  • Select WP_options

Under your database, you will see the WP-options table. Change the values on the "home" and "siteurl" rows on this table. You are required to enter the new URL then select "Go."

The changes will be made and from this point moving forward, you can only be able to access the dashboard through the new URL.

3.   Change WordPress URL in wp-config.php File

The other technique you can use to change your WordPress website is through the wp-config.php file. This method is recommended if making the change in the admin dashboard does not work. Note that having hard-coded values in your wp.config.php file will make it impossible to change the values.

You can change your WordPress URL in the wp.config.php manually. To make the changes, add the below lines in the file:

define( 'WP_HOME', 'http://enter correct URL );

define( 'WP_SITEURL', 'http://enter correct URL' );

By so doing, you will be hard coding the values in the general settings.

4.   Changing WordPress URL using WP-CLI

WordPress URL can be changed using WP_CLI. However, it is worth noting that a skilled developer best does this method. For the change to be effected, the developer must run specific tasks using command lines.

The common command lines used to update URL information are as below:

wp option update home 'http://entercorrecturl.com'

wp option update siteurl 'http://entercorrecturl.com'

"Entercorrecturl.com" is where you will enter the URL you want to update.

You must be wondering what will happen to your old pages and URLs once you have changed them. The common outcome is the presence of many broken links. Website owners should therefore take steps in handling the old links.

One of the solutions would be using an update URLs plugin. Broken links can be harmful to your website by increasing the bounce rate and weighing down the overall experience of navigating the website.

Apart from using the URL update plugin, you could leverage redirects. Redirect the broken links to relevant pages. If necessary, you can also delete the broken links. Alternatively, you can replace the broken links with the correct ones.

Can you change your WordPress URL? The simple answer is yes. There are several ways to change your WordPress URL, and you don't have to be a developer. The manuals above will help you successfully update your URLs.

Changing URLs is a good way of maintaining your WordPress website. You could do it to enhance the site's security, make the URLs SEO friendly when moving your website or directory and when doing a site makeover.

After making the changes, take some time to check if there are broken links and handle them. Failure to do so can affect the usability of your website through increased bounce rate, which may hurt your SEO.

People also read:

Susith Nonis

Susith Nonis

I'm fascinated by the IT world and how the 1's and 0's work. While I venture into the world of Technology, I try to share what I know in the simplest way with you. Not a fan of coffee, a travel addict, and a self-accredited 'master chef'.

user monovm

Helen Smitham V

2024, Jun, 24

This is a super informative guide on changing WordPress URLs! It's great to see the different methods laid out so clearly. I especially appreciate the tips on enhancing security and SEO, as well as the advice on handling broken links afterward. It's a comprehensive resource for anyone looking to maintain and optimize their WordPress site. Thanks for sharing!