The mPress Fix URL References plugin allows you to easily fix URL references in your WordPress database.
When you move your site from one domain to another, there is no built-in process for updating URL references in the database. For example, if you have internal links in your post content that point to the full URL of other pages on your site, these URL references will become invalid when you migrate your site to a new domain. If you aren’t a developer who knows how to write MySQL queries, replacing potentially thousands of instances of incorrect URLs is a real pain. No worries. I’m a developer and I’ve done all the work for you.
Using this plugin is simple:
- Ensure that you define the WP_HOME and WP_SITEURL constants in your wp-config.php file. It’s not that hard.
- Install the plugin
- Activate the plugin
- In the WordPress admin, click on ‘Fix URL References’ in the ‘Tools’ menu
- Enter the URL that you want to have replaced
- Click on ‘Fix References’
- Clean, well written code that won’t bog down your site
By default, this plugin only replaces URLs in specific tables and fields that would typically have URL references. I understand that this doesn’t meet everyone’s use cases, so this plugin exposes a simple PHP function for replacing string content from any given table and field.
Please only use this function if you know what you are doing:
mPress_Fix_URL_References::run_replacement_query( $table, $field, $old, $new );
This plugin replaces content in the ‘post_content’ field in the ‘posts’ table. The line of code below is from this plugin and is given as an example of how to use this function:
mPress_Fix_URL_References::run_replacement_query( 'posts', 'post_content', 'http://www.old-domain.com', 'http://www.new-domain.com' );
Notice how the table name doesn’t include the WordPress table prefix. This gets added automatically.
Does not work with 4.5.3, I tried several times, each time restoring the DB back after losing all CSS and other changes
Entered my URLs without a slash at the end. Deleted many tables entirely. Lost my custom CSS styles & my theme settings. Backup first!!
- Updated to release version after testing in WordPress 4.5.2
- Removed deprecated screen_icon() function (props Shelob9)
- Initial commit