How to reset your WordPress URLs

Applies to [aMiSTACX]. Sometimes you just need to update your WordPress store URLs because you are unable to access the website or the admin panel. Sometimes you just need to confirm what the WordPress URLs are.

Luckily for aMiSTACX users this process will take only a few minutes.

All you need to do is access the stack’s phpMyadmin*, and reset the URLs in the WordPress database.

phpMyadmin on older stacks is in the form of http://your_domain_or_ip/phpmyadmin/

Newer stacks have http://your_domain_or_ip:8080/phpmyadmin/

*Please see your stack guide for specific access instructions and make sure if you are using port 8080 that it is open for your IP.

Important! Before you begin, please disable any caching plugins or optimizer plugins.

The table you need to access is the wp_options table, and the entries you need to edit are option_id 1 & 2.

Basically OLD value, edit to NEW value, and save.

Change WordPress Site URLs from Database

If you hard-coded any URLs, you’ll unfortunately need to change all of them too! We strongly frown upon using any fully qualified URL for any part of WordPress, except of course for the base URLs.

All paths should be in relative path formats such as  /path/file omitting both domain name and protocol in the prefix.

In other words, https://amistacx.io/how-to-reset-your-wordpress-urls/ becomes /how-to-reset-your-wordpress-urls/ for any internal referenced path.

Reset via wp-config.php

You can also add the default WordPress base URLs in the wp-config.php file; however, this is not a great long-term solution as you can not modify the URLs from within the WordPress CMS. [They will be greyed out.]

define( 'WP_HOME', 'http://example.com' );
define( 'WP_SITEURL', 'http://example.com' );

Good to go!