Warning: Declaration of plugin_findreplace::addPluginSubMenu() should be compatible with mijnpress_plugin_framework::addPluginSubMenu($title, $function, $file, $capability = 10, $where = 'plugins.ph...') in /home/learnpeo/public_html/wp-content/plugins/find-replace/find_replace.php on line 17

Warning: Declaration of plugin_findreplace::addPluginContent($links, $file) should be compatible with mijnpress_plugin_framework::addPluginContent($filename, $links, $file, $config_url = NULL) in /home/learnpeo/public_html/wp-content/plugins/find-replace/find_replace.php on line 17

Warning: Cannot modify header information - headers already sent by (output started at /home/learnpeo/public_html/wp-content/plugins/find-replace/find_replace.php:17) in /home/learnpeo/public_html/wp-content/plugins/sg-cachepress/core/Supercacher/Supercacher_Helper.php on line 41
Learnpeople-SEO, SEM, Social Media-Helping your light in the world be found! Cincinnati, Dayton Ohio » WordPress Optimization of Database MySQL
Learnpeople-SEO, SEM, Social Media-Helping your light in the world be found! Cincinnati, Dayton Ohio
Previous Post:
Warning: Use of undefined constant - assumed '' (this will throw an Error in a future version of PHP) in /home/learnpeo/public_html/wp-content/themes/slidingdoor/single.php on line 6
 

WordPress Optimization of Database MySQL

Hopefully these lines of code will help you shrink your wordpress databases

You must use these by accessing PHPadmin from your control panel

DELETE wp_term_relationships FROM wp_term_relationships
LEFT JOIN wp_posts ON wp_term_relationships.object_id = wp_posts.ID
WHERE wp_posts.ID is NULL;
SELECT * FROM wp_commentmeta WHERE comment_id NOT IN ( SELECT comment_id FROM wp_comments );
DELETE FROM wp_commentmeta WHERE comment_id NOT IN ( SELECT comment_id FROM wp_comments );
SELECT * FROM wp_commentmeta WHERE meta_key LIKE ‘%akismet%’;
DELETE FROM wp_commentmeta WHERE meta_key LIKE ‘%akismet%’;
SELECT * FROM wp_postmeta pm LEFT JOIN wp_posts wp ON wp.ID = pm.post_id WHERE wp.ID IS NULL;
DELETE pm FROM wp_postmeta pm LEFT JOIN wp_posts wp ON wp.ID = pm.post_id WHERE wp.ID IS NULL;
DELETE FROM `wp_options` WHERE `option_name` LIKE “_transient_timeout_rss%”;
DELETE FROM `wp_options` WHERE `option_name` LIKE “_transient_rss_%”;
DELETE FROM `wp_options` WHERE `option_name` LIKE “_transient_timeout_feed_%”;
DELETE FROM `wp_options` WHERE `option_name` LIKE “_transient_feed_%”;
DELETE FROM wp_commentmeta WHERE comment_id NOT IN (SELECT comment_id FROM wp_comments);
DELETE FROM wp_terms WHERE term_id IN (SELECT term_id FROM wp_term_taxonomy WHERE count = 0 );
DELETE FROM wp_term_relationships WHERE term_taxonomy_id not IN (SELECT term_taxonomy_id FROM wp_term_taxonomy);
DELETE from wp_comments WHERE comment_approved = ‘0’;

 

 

MAKE SURE YOU OPTIMIZE YOUR DATABASE AFTER YOU DO THIS!

Posted 2 years, 7 months ago at 3:47 am.

Add a comment

LearnPeople helps organizations with the SEO, SEM, Social Media, Web Hosting and Design and Marketing needs.

LearnPeople.com John Bissman SEO SEM Social Media Marketing Communications 513-836-6023