How To Delete A WordPress MySQL Database

Learn how to delete a MySQL database in cPanel.

How To Delete A WordPress MySQL DatabaseThis tutorial is part of our WordPress Management tutorial series. In this tutorial, we show you how to delete a MySQL database in cPanel.

***

How To Delete A WordPress MySQL Database

If you want to permanently delete or remove a MySQL database (as opposed to keeping the database and simply emptying out, or ‘dropping’ all of the data and/or tables stored in your database), then follow the tutorial below to delete a MySQL database using cPanel.

To learn more about using cPanel, go here:

How To Delete A MySQL Database

Log into your cPanel administration area …

How To Back Up Your WordPress Database Using phpMyAdmin

Scroll down to the ‘Databases‘ section of your cPanel administration area and click on ‘MySQL® Databases‘ …

cPanel - Databases

Select the MySQL database you want to delete from the list of databases in the ‘Current Databases’ section and click on Delete Database

cPanel - Databases

Click ‘Delete Database‘ to proceed …

cPanel - Databases

Congratulations! You have successfully deleted the MySQL database. Click on ‘Go Back’ to return to the Databases section, or go back to your home screen to continue working in cPanel …

cPanel - Databases

See Also …

To learn how to create a MySQL Database, see the tutorial below:

How To Delete A WordPress MySQL Database

***

"Your training is the best in the world! It is simple, yet detailed, direct, understandable, memorable, and complete." Andrea Adams, FinancialJourney.org

***

How To Create A WordPress MySQL Database

Learn how to create a MySQL database for WordPress using cPanel’s MySQL Database Wizard.

How To Create A WordPress MySQL DatabaseThis tutorial is part of our WordPress Management tutorial series. In this tutorial, we show you how to create a MySQL database for WordPress using cPanel’s MySQL Database Wizard.

***

How To Create A WordPress MySQL Database

If you are performing a manual WordPress installation or adding a new application to your website that requires data to be stored in its own MySQL database, then follow the tutorial below to learn how to create a new MySQL database using cPanel.

To learn more about using cPanel, go here:

How To Create A MySQL Database

Log into your cPanel administration area …

How To Back Up Your WordPress Database Using phpMyAdmin

Scroll down to the ‘Databases’ section of your cPanel administration area and click on MySQL Database Wizard …

How To Install WordPress Using FTP

Create a database name and click ‘Next Step’ …

How To Install WordPress Using FTP

Note: In the above screenshot example, the prefix “wrdpress” is the domain username and “demo” is the database name. Your configuration will show a different domain username prefix.

Copy the entire ‘prefix_databasename’ string into a plain text file. You will need it later on during the installation process.

Next, create a username, and enter and verify a password (aim for a score of very strong – use the password generator if you need to), then click ‘Create User’ …

How To Install WordPress Using FTP

In the above screenshot example, the username is “demo1”.

In the next screen, do the following:

  • Copy the ‘User’, ‘Database’, and ‘Password’ details to a plain text file and save it to your hard drive. You will need these later.
  • Select the ‘ALL PRIVILEGES’ checkbox
  • After completing the above tasks, click on Next Step to proceed …

How To Install WordPress Using FTP

Congratulations! You have successfully created a MySQL database …

How To Install WordPress Using FTP

 See Also …

To learn how to delete a MySQL Database, see the tutorial below:

How To Create A WordPress MySQL Database

***

"I was absolutely amazed at the scope and breadth of these tutorials! The most in-depth training I have ever received on any subject!" - Myke O'Neill, DailyGreenPost.com

***

How To Do A Global Search And Replace In WordPress

Learn how to perform a global search and replace in WordPress without touching code.

How To Do A Global Search And Replace In WordPressWith WordPress, all of your content is stored in a database (called a MySQL database or SQL file) on your server, not page files. This means that if you need to make global changes to your content like replacing text or URLs throughout your site, these changes have to be made inside your WordPress database tables.

Editing WordPress database tables, however, requires having knowledge of MySQL. If you need to replace a string of text or links in your posts or pages, there are WordPress plugins that can help you save time by quickly searching either all fields and tables or specific areas of your WordPress database and then performing a global search and replace automatically.

In this tutorial, you will learn how to use plugins to easily perform a global search and replace in WordPress without touching code or editing your WordPress database tables.

How To Do A Global Search And Replace In WordPress

Being able to change content throughout your site quickly is important if you have many instances of text or links that need replacing, for example:

  • Changing a product/brand name or multiple product descriptions,
  • Replacing staff member names, telephone numbers, physical addresses, email addresses, etc.
  • Replacing misspelled words
  • Translations
  • Changing internal/external website URLs
  • etc.

Imagine the following scenarios:

Let’s suppose that you run a community website promoting various local sports teams and events and one of these teams is known as the ‘Rainbow Bay Hawks.’
One day, the ‘Rainbow Bay Hawks’ decide to change their name to the ‘Rainbow Bay Eagles.’
Now you have hundreds of instances where the team’s old name appears in your content. You want to replace the old name with the new name. How can you make these changes without manually editing every instance on your site?

Also, let’s say that your WordPress site includes many published posts and pages containing images stored inside your WordPress media folder.

As your site grows and new posts and pages get added, you then decide to move all of your images and media to an external storage location (e.g. Amazon S3) to help improve your site’s efficiency and make your pages load faster to visitors …

Transferring images to different storage locations require replace image URLs on existing content

(Transferring images to different storage locations require replace image URLs on existing content)

This transfer changes the path (i.e. the destination URL) of your images, which requires changing the URLs of all the images that you have embedded into your posts and pages.

In most situations, it would be quite impractical to go through every post and page on your site and do a manual search and replace of all image links. Fortunately, if you are a non-tech-savvy WordPress user, plugins provide a simple solution you can use to search and replace content throughout your site without having to access your WordPress database.

Info

If you transfer images to a different image storage location without changing the URL of the images in your content, your posts and pages will continue displaying images stored in the old location (e.g. your WordPress images folder).

If you delete your images from the WordPress images folder or change image URLs before transferring images to the new location, your posts and pages will display “missing image” errors …

Incorrect image links lead to missing image errors

(Incorrect image links lead to missing image errors)

When transferring images published on existing content to a different storage location, follow the steps shown in the order below to avoid errors:

  1. Add images to the new location
  2. Write down the destination path to the new images folder
  3. Perform a global search and replace to change the old path URL to the new destination using a search and replace plugin
  4. Delete images from the old folder or just ignore these.
  5. All of your image links will now point to the new storage location.

Search And Replace

WP Search & Replace global search and replace plugin

(Search & Replace)

Search & Replace is a free plugin that allows you to perform a simple search to find strings in your WordPress database and then replace that string.

You can search for content strings in areas of your database such as ID, post-content, GUID (Globally Unique Identifier), title, excerpt, meta-data, comments, comment-author, comment-e-mail, comment-url, tags/categories, categories-description, and many others. You can also use this plugin to replace the user-ID in all tables and the user-login for site security purposes.

Plugin Download

You can download the Search And Replace WordPress plugin here:

https://wordpress.org/plugins/search-and-replace/

Plugin Installation

To install Search And Replace, log into your WordPress admin, go to Plugins > Add New 

Plugins - Add New

(Plugins – Add New)

Type in “search-and-replace” in the Search field and click on Search Plugins

Add Plugins > Search And Replace

(Add Plugins Menu > Search And Replace)

Locate the ‘Search & Replace’ plugin and click Install Now to install the plugin …

Install Search & Replace

(Install Search & Replace)

Activate the plugin after installation …

Activate the plugin

(Activate the plugin)

You can also activate your plugin by going to Plugins > Installed Plugins …

WP Plugins Menu - Installed Plugins

(WordPress Plugins – Installed Plugins)

This brings you to the ‘Plugins’ screen …

Plugins screen

(Plugins screen)

Locate the ‘Search & Replace’ plugin in the ‘Plugins’ screen and click Activate

Activate the plugin

(Activate the plugin)

The plugin will be activated and ready to use …

Search & Replace plugin is now active

(Search & Replace plugin is now active)

Plugin Usage

To access the plugin’s search and replace features, go to Tools > Search & Replace

Tools > Search & Replace

(Tools > Search & Replace)

This takes you to the ‘Search & Replace’ screen …

Search & Replace screen

(Search & Replace screen)

Using The Search & Replace Plugin

The Search & Replace plugin allows you to perform a number of useful functions, including:

  • Backing up your database
  • Replacing domain URLs
  • Importing MySQL databases

For the purposes of this tutorial, let’s focus on searching and replacing text strings.

Click on the ‘Search & Replace’ tab …

Search & Replace tab

(Search & Replace tab)

Here you can search for text or strings in all database tables, or just in specific tables, and perform global or specific search and replace operations …

Search & Replace fields

(Search & Replace fields)

Note

Backup your WordPress site before using this plugin! You cannot undo the changes made to your database by the plugin.

Using our previous example, let’s say that you want to replace all instances of the old link structure where images were being stored with links pointing to your new image folder location …

Let's replace all instances of this URL

(Let’s replace all instances of this URL)

First, make a backup of your WordPress database, then go to Tools > Search & Replace and do the following:

  1. Enter the URL to be replaced in the Search for: field (1)
  2. Enter the new URL into the Replaced with: field (2)
  3. Check Select all tables to find and replace strings in all of your database tables or select only the specific database tables to perform the search and replace function by clicking on individual table items (3)
  4. As a safety precaution, we recommend leaving the Dry Run box ticked. If you uncheck this box, the plugin will begin performing a search and replace as soon as you click the start button.
  5. Click on ‘Do Search & Replace’ to begin …

Search & Replace

Search & Replace

(Search & Replace)

The plugin will begin to search and replace the strings in your WordPress database and let you know when the operation has been completed …

Search and replace results

(Search and replace results)

When performing a ‘dry run’, no changes will be made in your database. You can view the results by clicking on the ‘View details’ link …

Search & Replace - View details

(Search & Replace – View details)

To perform the changes, repeat the process, but change the following settings:

  • Make sure ‘Select all tables’ box is ticked
  • Deselect ‘Dry Run’ checkbox
  • Select the ‘Save changes to Database’ option in the ‘Export SQL file or write changes to DB?’ setting …

Use these settings to perform the actual search and replace

(Use these settings to perform the actual search and replace)

The plugin will perform the search and replace operation and save the changes to your database.

Search and replace operation completed

(Search and replace operation completed)

If you don’t want to save the changes to your database, you can export an SQL file with the changes instead (useful for developers) …

Making a search and replace to SQL file instead of your actual database

(Making a search and replace to SQL file instead of your actual database)

Once the operation has been completed, go back to your post or pages and check the results …

Global search and replace performed!

(Global search and replace performed!)

The old image links on all of your posts and pages have now been replaced.

For more information about this plugin, visit the plugin site here:

Alternative Search & Replace Plugins

In addition to the Search & Replace plugin described above, there are other search and replace plugins that you can use.

Better Search Replace

Better Search Replace WordPress Plugin

(Better Search Replace)

Better Search Replace consolidates and incorporates the best features from many search and replace plugins, incorporating the following features in one simple plugin, including:

  • 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
  • A ‘PRO’ version with advanced/additional search and replace features

For more details, go here}:

Real-Time Find And Replace

Real-Time Find and Replace WordPress Plugin

(Real-Time Find and Replace WP Plugin)

This plugin allows you to dynamically (i.e. at the time when a page is generated) replace code and text from themes and other plugins with code and text of your choosing before a page is delivered to a user’s browser. Because the find and replace happens in real-time no changes are needed to plugins or themes. A ‘PRO’ version is available with advanced/additional features.

For more details, go here}:

Text Replace

Text Replace

(Text Replace Plugin For WordPress)

This plugin allows you to easily define text or HTML that should be used in your posts in place of words or phrases that are actually present in the posts. This is a handy technique for creating shortcuts or content ‘placeholders’ to common, lengthy, or frequently changing text/HTML, or for smilies.

For more details, go here}:

You can search for more WordPress search and replace plugins inside your WordPress dashboard (Plugins > Add New), or the WordPress Plugin Repository …

WordPress Plugins - Search and Replace

(WordPress Plugin Search – search and replace)

Search the WordPress Plugin Directory for search and replace plugins below:

Congratulations! Now you know how to perform a quick global search and replace in WordPress without touching code or editing your WordPress database tables.

How To Do A Global Search And Replace In WordPress

(Source: Pixabay)

***

"If you're new to WordPress, this can stand on its own as a training course and will stay with you as you progress from beginner to advanced and even guru status." - Bruce (Columbus, Ohio)

***