• 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.

This Article Has Been Shared 394 Times!

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

  • Follow the traffic to your WordPress blog with Google Analytics plugin

    To find the plugin to follow traffic your blog is not easy when you face with a pile of plugins that provide the same service with a few differences.

  • Some of the best WordPress plugins

    Here are some best Wordpress plugins we have used, using or tested. All are free.

  • Cache Plugin and Leverage Browser Caching, Set Expires Header CDN Issue

    Leverage Browser Caching, Set Expires Header appears when we use a CDN with W3 Total Cache Plugin or WP super Cache with CDN Sync tool.What is the fact behind?

  • WordPress FTP Zip Backup Restore Plugin

    WordPress FTP Zip Backup Restore Plugin is a simple WordPress site restore Plugin, when used with our FTP to Zip Plugin, it exactly clone your WordPress.

  • How to Use Subversion From CLI For WordPress Plugin

    Most Get Confused to Use Subversion From Command Line. Here is How to Use Subversion From CLI For WordPress Plugin First Release or Update.

Additionally, 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

  • What is Voice User Interface (VUI) January 31, 2023
  • Proxy Server: Design Pattern in Programming January 30, 2023
  • Cyberpunk Aesthetics: What’s in it Special January 27, 2023
  • How to Do Electrical Layout Plan for Adding Smart Switches January 26, 2023
  • What is a Data Mesh? January 25, 2023

About This Article

Cite this article as: Abhishek Ghosh, "How To Fix : WordPress Database Size Too Large," in The Customize Windows, September 2, 2022, January 31, 2023, https://thecustomizewindows.com/2022/09/how-to-fix-wordpress-database-size-too-large/.

Source:The Customize Windows, JiMA.in

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

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT