My WordPress sites starting to become slower by time, after two years they become very slow. I tried many things, such as:
- improved my DB,
- used cache plugins (WP Rocket and W3 Total Cache) which both are great, rocket is a little better but you have to pay for it,
- checked effects of analytics on my site (deactivating slimstat analytic improved my response time by 20%),
- handling heart beat (WP Rocket has a way to control heart beat).
Finally I checked core tables of WordPress (
wp_postmeta) the main reason that my WordPress site is slow is because of the
wp_postmeta, and unfortunately WooCommerce save its meta in the
wp_postmeta which affects response time drastically.
All of these aside, there is one more thing that has strong affect on the speed, and that is the length of
_wp_attachment_metadata which for my site is more that 1024 character.
How could I optimized this (
_wp_attachment_metadata) metadata without loosing all the sizes which I need?
Finally if I change the type of
varchar(2024) (which I assume all plugins produce meta data with less characters) and then index it. Would it make any problem with core of WordPress?