• Resolved lemonxxl

    (@lemonxxl)


    Hi all.
    I tried to remove old orders from my site with mysql queries. All was fine except that wp_postmeta increased size and added more rows. Rows from queries removed but not sure what is added.
    I used this mysql query
    DELETE FROM wp_postmeta WHERE post_id IN (SELECT ID FROM wp_posts WHERE post_type = ‘shop_order’ and post_date < NOW() – INTERVAL 1 YEAR);

    Any idea?

    thanks
    Darko

Viewing 1 replies (of 1 total)
  • Hey there, @lemonxxl! Thanks for contacting us. I’m happy to help you.

    After large deletions, it’s a good idea to optimize the table to reclaim any unused space and reduce overhead. You can do this by running the following query in your MySQL database:

    OPTIMIZE TABLE wp_postmeta;

    This should help reduce the size of the table and clean up any leftover fragmentation.

    You can also use a plugin such as WP-Optimize or WP-DBManager if you prefer.

    Please let us know how it goes.

    Have a wonderful day!

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.