---
title: Using Search and Replace on WordPress and Your Pressable Site
url: "https://pressable.com/knowledgebase/using-search-replace-on-your-pressable-site/"
published: 2019-08-13
modified: 2026-02-14
author: Wayne McWilliams
---

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:

 
 Warning before doing anything to your Database!  Run a backup of your database before making any changes. If you have a backup of your database and make a mistake, then you can quickly revert to the backup and have the site up and running again.
[Click here to learn how to backup your site and Database.](https://pressable.com/knowledgebase/how-to-manually-back-up-your-site/)

### My.Pressable.com Dashboard

In the individual site section of the [My.Pressable.com Dashboard](https://my.pressable.com/) at **Sites → Individual Site → Site Tools → Search & Replace**:

![](https://i0.wp.com/pressable.com/wp-content/uploads/2019/08/sr1.jpg?resize=1904%2C832&ssl=1)This feature allows users to search their site’s database for a specific term and replace it with another.

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 Activity Log located within My.Pressable.com Dashboard (**Sites → Individual Site → Logs > Activity Log**):

![](https://i0.wp.com/pressable.com/wp-content/uploads/2019/08/sr2.jpg?resize=1024%2C458&ssl=1)### WordPress Plugin: [Better Search Replace](https://wordpress.org/plugins/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](https://wordpress.org/plugins/better-search-replace/)

### WP-CLI / SSH

You can run a search/replace on the database using WP-CLI via [SSH](https://pressable.com/knowledgebase/connect-to-ssh-on-pressable/). 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.

**Note:** The `--all-tables` flag should only be used if you’ve already run the command without it and the replacement you’re attempting hasn’t been effective.

```
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.](https://i0.wp.com/pressable.com/wp-content/uploads/2019/08/wpcli-search.png?resize=1061%2C104&ssl=1)[Click here to view the full list of WP-CLI commands for search/replace](https://developer.wordpress.org/cli/commands/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.
