Using Search and Replace on WordPress and Your Pressable Site

Last modified: September 11, 2025

When you set up a site on Pressable, a staging URL is created:
{site_name}.mystagingwebsite.com

There are a couple of advantages of this staging URL:

  • Migrating a site from another host: You can move the files and database and test before changing DNS.
  • Cloning a site already on Pressable: Test updates, make changes, etc., without modifying your live site.

Using Search/Replace

When you add a domain to your site, often times the staging URL remains in your database instead of being replaced by the live domain. These will all 301 redirect to the primary domain. However, in these instances you may want to run a search/replace of the staging URL to your live domain. There are a couple of ways to accomplish this:

My.Pressable.com Dashboard

In the individual site section of the My.Pressable.com Dashboard (Sites > Individual Site > Advanced), there is a Search Replace section:

Search/Replace feature location in My.Pressable.com Dashboard menu.

This feature allows users to search their site’s database for a specific term and replace it with another.

Search/Replace feature option in My.Pressable.com Dashboard.

The Search Replace functionality includes an option to run on all tables and an automated multisite check. Depending on the criteria met, either --network or --all-tables is added to the command.

command = "wp --skip-plugins --skip-themes search-replace '#{search_text}' " \ "'#{replace_text}' --no-report" if is_multisite command += ' --network' log_messages << 'Added --network flag' wordpress_operation.update!(log_messages: log_messages) end if all_tables command += ' --all-tables' log_messages << 'Added --all-tables flag' wordpress_operation.update!(log_messages: log_messages) end

Once a search/replace operation has run, it will show up in the WordPress History log located within My.Pressable.com Dashboard (Sites > Individual Site > WordPress > History):

WordPress Plugin: Better Search Replace

There are several plugins available for this task. However, all have a different approach to a few key features. This plugin consolidates the best features from these plugins, incorporating the following features into one simple plugin:

  • Serialization support for all tables
  • The ability to select specific tables
  • The ability to run a “dry run” to see how many fields will be updated
  • No server requirements aside from a running installation of WordPress
  • WordPress Multisite support

Click here to visit the Plugin page at WordPress.org

WP-CLI / SSH

You can run a search/replace on the database using WP-CLI via SSH. When logged into the site via SSH, use this WP-CLI command to automatically search through all tables in a database to replace one string with another string:

wp search-replace https://oldurl.com https://newurl.com --all-tables

You’ll be required to flush the site cache after running the search-replace command like so

wp cache flush
WP-CLI command example of search-replace on a Pressable site.

Click here to view the full list of WP-CLI commands for search/replace

Contact Pressable Support

If you have tried this plugin and are having issues, or just want Pressable Support to help, please contact us at help@pressable.com. Please provide the live domain of the site you need help with and we can make this update for you.