Better Search Replace
Step 1: Install the Plugin
- Log in to your WordPress Dashboard.
- Go to Plugins → Add New.
- Search for Better Search Replace and click Install Now.
- Activate the plugin after installation to start using it.
Step 2: Open the Plugin
- Once activated, you'll find a new menu item under Tools → Better Search Replace.
Step 3: Set Search and Replace Parameters
- In the plugin window, you'll see two important fields:
a. Search For: Enter the text you want to search for (e.g., an old URL).
b. Replace With: Enter the new text that will replace the old entries (e.g., a new URL). - Select the database tables where you want the changes to occur (e.g., wp_posts for posts and pages).
- Optional Feature: Run a "Dry Run" to see how many entries will be affected without making actual changes.
Step 4: Perform the Changes
- Once you've entered the search and replace values, click Run Search/Replace to make the changes.
- After the process is completed, you'll receive a confirmation showing how many entries were updated.
Important Tips:
-
Create a Backup: It's advisable to create a backup of your database before making large-scale changes.
-
Use Cases: The plugin is ideal for updating URLs after a domain change, fixing outdated content, or correcting mistakes across multiple posts at once.
With this guide, you can easily and efficiently make mass updates to your WordPress database and ensure your website stays up to date.
Step 5: Add Domain Alias and Change Main Domain
After making the changes in WordPress, you need to add the new domain as an alias in MyPanel and then set it as the main domain:
- Navigate:
- Log into MyPanel and go to Hosting → Settings.
- Choose Subscription:
- Select the hosting subscription where you want to modify the domain settings.
- Add Domain Alias:
- Click on the desired website and choose Domain Aliases. Click on Edit Aliases and add the new domain as an alias.
- Change Main Domain:
- After adding the domain alias, select the new domain in the Domain Aliases section and click Change Main Domain. The new domain will now be used as the main domain.
By following these steps, you can successfully add a domain alias and set it as the main domain in MyPanel.