How to remove unnecessary text in WordPress all at once

When writing posts using WordPress, it’s common to add FAQs or instructions to all of your posts. I’ve added instructions to over 200 posts myself, and it’s been very time-consuming trying to remove the text I’ve added because I don’t need it anymore.

To save time, I looked for ways to remove unnecessary text in one go. The first way I found was to use a plugin that allows you to temporarily hide text.

With the plugin, the text is invisible when you open the post, but when you switch to edit mode, the text is still there. So I looked for another way to completely delete it, and found a way to bulk delete it from the database.

The way to delete from the database is to run a delete query in PHPMyAdmin to remove it all at once. I had CyberPanel installed, so I could easily access the database and delete the unnecessary text all at once.

If you have unnecessary text like I did, follow the instructions below to quickly remove it.

  • If you make any modifications to your database, be sure to take a backup before doing so, as this can cause issues with your site.

Table of Contents

PHPMyAdmin

remove

To enter PHPMyAdmin, you can download the program and do it yourself, but in my case, I have CyberPanel tool installed, so I can enter PHPMyAdmin when I see the Databases menu as shown above.

If you have difficulty installing the PHPMyAdmin program or don’t have a tool like CyberPanel, you can install the WP PHPMyAdmin plugin to access it.

SQL Query – Remove Text

remove

When you connect to PHPMyAdmin, you should see a screen like the one above. Select the topmost table in the list of tables on the left.

remove

UPDATE wp_posts

SET post_content = REPLACE(post_content, ‘Text to remove‘, ”)

WHERE post_content LIKE ‘%Text to remove%’;

After selecting the topmost table, you can add the above query by clicking SQL in the top menu. Then hit the Run button and the text you specified will be removed from the selected table.

remove

Click the Run button and it will take effect as shown above. You can also see the numbers that were removed.

With a query like this, you can easily remove unnecessary text from all of your posts. As a reminder, modifying your database can affect your site, so be sure to back up before doing anything.

▶ AMP for WP Plugin: How to Apply Automated Ads

▶ What is the LiteSpeed_task_lqup error and is it essential for the site?

▶ A browser extension for adjusting YouTube colors and fixing video quality.

Leave a Comment

Your email address will not be published. Required fields are marked *