How to change WordPress Site URL?


EXPERIENCING PROBLEMS WITH OUR SERVICES? RUN A DIAGNOSE FIRST TO SAVE YOURS AND OUR TIME

Added: 14.08.2019 17:19:44     Last updated: 15.08.2019 14:30:42

This guide will show you two ways to change the URL (address) of WordPress.

Why change URL in WordPress?

  • It is desirable to switch to www instead of without www.
    For example, if you use Cloudflare trough PRO ISP inside cPanel then www must be set as the URL.
  • It is desirable to change to https from http.
    https is recommended both for the security and speed for the web pages.
  • The installation has been moved from a subdirectory or subdomain.
    For example, it is desirable to move the page from test.exampledomain.org to exampledomain.org Or exampledomain.org/blog to exampledomain.org.
  • It is desirable to move from one domain name to another. Or from a temporary address to the domain name.
    For example, oldexampledomain.org to exampledomain.org.

Change the URL in phpMyAdmin

In this example, we'll change the URL from:
https://www.exampledomain.org/wordpress/ to https://www.exampledomain.org/. In advance, we have moved the files/folders from the wordpress folder to the public_html folder. When accessing the domain now it will not work.Its' needed to change the URL in WordPress to get access again.

Step 1:
Login to cPanel and click on "phpMyAdmin".

  1. Click the database you want to change the URL.
  2. Click the "_options" table.
  3. Under the "siteurl" and "home" rows you will find the old address that needs to be changed. Double-click the box under "option_value" and change the URL to https://www.exampledomain.org/ in both fields.
Change WP siteurl and home url in phpmyadmin

Done
You will now have access to WordPress on the https://www.exampledomain.org/ page, but all previous URLs in the database will still use the old address that needs to be changed.


Change URL in wp-config.php

In this example we will change the URL to the same as shown in the example above.

Step 1:
Login to cPanel and click on "File Manager".

  1. Click on the "public_html" folder on the left menu.
  2. Go down and click on the wp-config.php file.
  3. Then click "Edit" in the top menu.
Change url for WordPress in wp-config.php file in cPanel


Step 2:
Now the file is open for editing and above "/ * That's all, stop editing! Happy publishing. * /" you can enter these two lines:
define ('WP_HOME', 'https: //exampledomain.org/');
define ('WP_SITEURL', 'https: //exampledomain.org/');

Then save the file as shown by the arrow.

File Mananger in cPanel where you change URL for WordPress

Done
You will now have access to WordPress site on the https://www.exampledomain.org/ page, but all previous URLs in the database will still use the old address that needs to be changed.