• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » How To Fix : WordPress Database Size Too Large

By Abhishek Ghosh September 2, 2022 4:56 pm Updated on September 2, 2022

How To Fix : WordPress Database Size Too Large

Advertisement

Often some WordPress users complain about a huge database size, the size often crosses 10 GB. Such kind of situation is not healthy for the installation and measures must be taken to find out the culprit and reduce the database. A few of the known reasons behind such growth in database size are:

  • Log entry in to MySQL database. This can happen out of a faulty plugin or faulty settings.
  • Deleted plugin with data in database
  • Spam comments

There may be many other reasons but unusually too large a database size is often related to logging from some plugin. If you are using InnoDB engine, the culprit is almost always a faulty plugin adding log.

How To Fix WordPress Database Size Too Large

 

Find Out Why WordPress Database Size is Too Large

 

To investigate the situation, you need just a WordPress plugin (such as WP-Optimize) to look at the name of the table which is unusually large. Alternatively, you may use PHPMyAdmin or check from the command line of MySQL. One of our readers reported having a MySQL database size of 8.81 GB. The website had 10K posts. Only she could report to us that wp_posts table is 7.89 GB. That pointed out that some plugin is automatically appending some log files to the wp_posts table.

Advertisement

---

We asked her to run an SQL command to check the rows :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
SELECT
  post_type,
  COUNT(*) AS <code>Rows</code>,
  ROUND(
    SUM(
      LENGTH(
        CONCAT(
          ID, post_author, post_date, post_date_gmt, post_content, post_title, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping, pinged, post_modified, post_modified_gmt, post_parent, guid, menu_order, post_type
        )
      )
    )/1048567, 2
  ) AS <code>Data_in_MB
  FROM wp_posts
  GROUP BY post_type
  ORDER BY <code>Data_in_MB</code> DESC;

Which revealed that post_type Http has a huge number entry. Ultimately, I logged in to her WordPress instance and discovered that the WordPress plugin named REST API Log is growing the size of the database.

 

Plan a Fix

 

The first and foremost important action is taking a working MySQL backup from the command line. In the above-described situation, trying to manipulate from any web interface could result in devastation.

We asked her to take a backup. She had WP-CLI installed. We suggested her to run the following commands:

Vim
1
2
wp help rest-api-log
wp rest-api-log purge

Thankfully the command very slowly worked and she could reduce the database size. If the above methodology failed, we could use the below query:

Vim
1
DELETE a,b,c FROM wp_posts a LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id) LEFT JOIN wp_postmeta c ON (a.ID = c.post_id) WHERE a.post_type = ‘http’.

 

Conclusion

 

The problem with too large database size needs a careful investigation to find out the faulty plugin. It is likely that some other user already faced the same problem and described steps to get rid of it.

But before doing anything as we have warned you – always take a working MySQL backup.

Tagged With wordpress big database
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to How To Fix : WordPress Database Size Too Large

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • Changing Data With cURL for OpenStack Swift (HP Cloud CDN)

    Changing Data With cURL For Object is Quite Easy in OpenStack Swift. Here Are Examples With HP Cloud CDN To Make it Clear. Official Examples Are Bad.

  • WordPress & PHP : Different AdSense Units on Mobile Devices

    Here is How To Serve Different AdSense Units on Mobile Devices on WordPress With PHP. WordPress Has Function Which Can Be Used In Free Way.

  • Join/Merge Multiple Log Files For Big Data Analysis

    Here Are The Ways To Join/Merge Multiple Log Files For Big Data Analysis, Store Them To OpenStack Based Cloud Storage And Delete Old Files.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy