{"id":2293,"date":"2011-06-28T23:53:27","date_gmt":"2011-06-28T18:23:27","guid":{"rendered":"http:\/\/JitendraZaa.com\/blog\/?p=2293"},"modified":"2011-06-28T23:53:27","modified_gmt":"2011-06-28T18:23:27","slug":"free-up-mysql-space-in-wordpress-delete-akismet-logs","status":"publish","type":"post","link":"https:\/\/www.jitendrazaa.com\/blog\/webtech\/free-up-mysql-space-in-wordpress-delete-akismet-logs\/","title":{"rendered":"Free up MySQL Space in WordPress &#8211; Delete Akismet Logs"},"content":{"rendered":"<p>Akismet is owsome plugin to protect your WordPress site from the spams. However, before writing this article, i was checking the space used by the database. I was so\u00a0surprised\u00a0when i saw that the table named &#8220;<strong>wp_commentmeta<\/strong>&#8221; was having more than 11k records using 20MB of the space.<\/p>\n<p>After some time, i found that Akismet uses that table as a log to display the reports about spam. Spams are automatically deleted by akismet, but entry for every spam was maintained in that table.<\/p>\n<p>When i run below query to find the orphan comments meta :<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nSelect * FROM wp_commentmeta WHERE comment_id NOT IN\n(SELECT comment_id FROM wp_comments)\n<\/pre>\n<p>There were nearly 10k records which were orphans. To free up the memory, i run below query<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nDELETE FROM wp_commentmeta WHERE comment_id NOT IN\n(SELECT comment_id FROM wp_comments)\n<\/pre>\n<p>With the help of above query, i free up nearlly 18MB of space.<\/p>\n<p>Please leave your valuable feedback over the same problem.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Free up MySQL Space in Wordpress &#8211; Delete unused Akismet Logs <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"jz_research_post":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[19],"tags":[148,223],"class_list":["post-2293","post","type-post","status-publish","format-standard","hentry","category-webtech","tag-mysql","tag-wordpress"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":2861,"url":"https:\/\/www.jitendrazaa.com\/blog\/sql\/pagination-and-switch-case-in-where-clause-sql-server\/","url_meta":{"origin":2293,"position":0},"title":"Pagination and Switch Case in Where clause &#8211; SQL Server","author":"Jitendra","date":"May 19, 2012","format":false,"excerpt":"Example of using pagination and switch case in where clause in SQL server","rel":"","context":"In &quot;SQL&quot;","block_context":{"text":"SQL","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/sql\/"},"img":{"alt_text":"SQL Server Employee Table","src":"https:\/\/i0.wp.com\/jitendrazaa.com\/blog\/wp-content\/uploads\/2012\/05\/SQL-Server-Employee-Table.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":448,"url":"https:\/\/www.jitendrazaa.com\/blog\/sql\/search-for-table-in-sql-server\/","url_meta":{"origin":2293,"position":1},"title":"Search for Table in SQL Server","author":"Jitendra","date":"June 30, 2010","format":false,"excerpt":"In\u00a0organization, where huge number of tables present in database. its very hard to search the particular table. Here few SQL queries to search the table name by pattern. Search For Table whose name starts with A [sourcecode lang=\"sql\"] SELECT DISTINCT [Table] = OBJECT_NAME(OBJECT_ID) FROM SYS.INDEXES WHERE OBJECTPROPERTY(OBJECT_ID,'IsUserTable') = 1 AND\u2026","rel":"","context":"In &quot;SQL&quot;","block_context":{"text":"SQL","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/sql\/"},"img":{"alt_text":"List of Non clustered Tables in SQL Server 2005","src":"https:\/\/i0.wp.com\/jitendrazaa.com\/blog\/wp-content\/uploads\/2010\/06\/Non-clustered-Tables.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1125,"url":"https:\/\/www.jitendrazaa.com\/blog\/sql\/sqlserver\/get-table-information-column-name-data-type-in-sql-server\/","url_meta":{"origin":2293,"position":2},"title":"Get Table information (Column Name, Data Type) in SQL Server","author":"Jitendra","date":"September 18, 2010","format":false,"excerpt":"Get Table information like Column Name, Data Type, Character length, Default Values etc in SQL Server","rel":"","context":"In &quot;SQL Server&quot;","block_context":{"text":"SQL Server","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/sql\/sqlserver\/"},"img":{"alt_text":"SQL Server INFORMATION_SCHEMA.COLUMNS","src":"https:\/\/i0.wp.com\/jitendrazaa.com\/blog\/wp-content\/uploads\/2010\/09\/SQL-Server-INFORMATION_SCHEMA.COLUMNS-300x44.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1147,"url":"https:\/\/www.jitendrazaa.com\/blog\/sql\/sqlserver\/between-clause-problem-in-date-comparison-sql-server\/","url_meta":{"origin":2293,"position":3},"title":"Between Clause problem in Date comparison &#8211; SQL Server","author":"Jitendra","date":"September 23, 2010","format":false,"excerpt":"SQL Server Date Comparison Tips : Never user Between clause with DateTime in SQL Server","rel":"","context":"In &quot;SQL Server&quot;","block_context":{"text":"SQL Server","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/sql\/sqlserver\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":5882,"url":"https:\/\/www.jitendrazaa.com\/blog\/sql\/sqlserver\/sql-server-read-all-files-in-directory-and-store-in-table\/","url_meta":{"origin":2293,"position":4},"title":"SQL Server &#8211; Read all files in directory and store in Table","author":"Jitendra","date":"January 18, 2017","format":false,"excerpt":"T-SQL Script to read all files in directory and store back in table - SQL Server","rel":"","context":"In &quot;SQL Server&quot;","block_context":{"text":"SQL Server","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/sql\/sqlserver\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":829,"url":"https:\/\/www.jitendrazaa.com\/blog\/sql\/sqlserver\/convert-rows-into-comma-separated-values-column-sql-server\/","url_meta":{"origin":2293,"position":5},"title":"Convert rows into comma separated values column &#8211; SQL Server","author":"Jitendra","date":"October 4, 2010","format":false,"excerpt":"Convert rows into comma separated values column - SQL Server","rel":"","context":"In &quot;SQL Server&quot;","block_context":{"text":"SQL Server","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/sql\/sqlserver\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/posts\/2293","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/comments?post=2293"}],"version-history":[{"count":0,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/posts\/2293\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/media?parent=2293"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/categories?post=2293"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/tags?post=2293"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}