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!
- Debt and Liability: Most small businesses and startups accept the personal liability associated with a sole proprietorship or partnership as a necessary risk of doing business. If you’re in a high-risk industry (such as selling CBD or firearms online) or simply want to keep your business and personal matters private, you can limit personal liability by filing for a more formal business structure. The downside is that this typically takes more paperwork, costs more to register, and may have greater reporting or upkeep requirements than simpler business types, learn about TikTok views.
- Filing taxes: To oversimplify a bit, you have two options when it comes to filing your business taxes. You can file business profits/expenses on your own personal tax returns, or you can have your business file taxes separately as its own entity. Most small business owners prefer the simplicity of filing taxes on their own returns, but filing business taxes individually can help you keep your personal and business finances separate.
- Partners or Investors: If you’re starting your business with a partner or private investor, you won’t be able to form a sole proprietorship. You can choose between a partnership (where all responsibilities and liability are shared equally), a limited partnership (which lets you dictate responsibilities and liabilities for individual members), or an LLC (to protect all members from personal liability).
- Hiring employees: Some of the simplest business types—like sole proprietorships—can make it difficult to hire employees down the road. While it’s possible to change your business type to grow with your business, if you already have employees or plan to hire employees, it may be better to future-proof with a more formal business structure like an LLC or corporation.