How to change WordPress URLs

How to change WordPress URLs

Contents

Using phpMyAdmin

ATTENTION: SiteWorx is only available to Nexcess Classic (non-Cloud) clients. If you are a Cloud client, learn about how to access phpMyAdmin from What is phpMyAdmin?, then begin at Step 3.

  1. Log in to your SiteWorx account.

    • If you do not know your password, click Forgot your password on the login page.
    • If you do not know the web address for your SiteWorx login page, either refer to your Welcome Email or contact our 24-hour Support Team for assistance.

  2. From the main menu, select Hosting Features > MySQL > PhpMyAdmin.


  3. From the main menu, select the desired database, then click wp_options.


  4. In the main table, locate the wp_options table.


  5. In the option_name column, locate the siteurl entry and click the corresponding Edit option.


    In the option_value field, enter the URL, then click Go.


  6. Under the option_name column, locate the home entry, and corresponding Edit option.


    As in Step 5, in the option_value field, enter the URL, and then click Go to save the change.

  7. If you have a WordPress caching module, flush the module's cache, and the new URLs should work correctly. 

Using the command line (CLI)

This method requires SSH access. If you are a Nexcess Classic (non-Cloud) client, first see How to enable SSH access. If you are a Nexcess Cloud client, SSH access is on by default.

  1. Log in to your server, using SSH credentials provided to you by a Nexcess Support Technician.
  2. Enter your MySQL database by executing the below command, but replace the angled brackets (<>) and everything between them with the name of the WordPress database:

    use <database>

  3. Execute the following commands, replacing the the angled brackets (<>) and everything between them with the indicated information:

    UPDATE wp_options SET option_value = replace(option_value, 'http://www.<old_url>', 'http://www.<new_url>') WHERE option_name = 'home' OR option_name = '<siteurl>';

    UPDATE wp_posts SET post_content = replace(post_content, 'http://www.<old_url>', 'http://www.<new_url>');

    UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.<old_url>','http://www.<new_url>');

  4. If you have a WordPress caching module, flush the module's cache, and the new URLs should work properly.  

 

For 24-hour assistance any day of the year, contact our Support Team by email or through the Client Portal.

Article Rating (No Votes)
Rate this article
  • Icon PDFExport to PDF
  • Icon MS-WordExport to MS Word
 
Attachments Attachments
There are no attachments for this article.
Related Articles RSS Feed
How to add Favicons to WordPress
Added on Tue, Jan 8, 2019
How to combat WordPress comment spam
Added on Wed, Jan 2, 2019
How to change your WordPress admin password
Added on Mon, Jun 4, 2018
How to secure your WordPress site
Added on Wed, Dec 26, 2018
How to create WordPress dev sites
Added on Mon, Dec 31, 2018
How to configure WordPress plug-ins
Added on Thu, Jan 10, 2019
How to install WordPress
Added on Tue, Jan 8, 2019
How to configure the Nexcess CDN with WordPress and W3 Total Cache
Added on Thu, Mar 8, 2018
What is WordPress?
Added on Wed, Sep 11, 2013
How to configure WordPress file permissions
Added on Wed, Jan 2, 2019