• How do I remove all values by brand?

    $allpostids = ‘All Postids’;

    $allmetakeys = ‘All Metakeys With Dots And Numbers’;

    $allnumberswithcomma = ‘All numbers with comma’ ‘ Markerfordeletion’;

    Delete_post_meta ($allpostids, $allmetakeys, $allnumberswithcomma);

    How to remove all values with the Mark Markerfordeletion

    • This topic was modified 5 years, 5 months ago by manoodin.
    • This topic was modified 5 years, 5 months ago by manoodin.
Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    I don’t follow how your criteria would match a brand, but maybe it doesn’t matter. The general answer is you can use wpdb::delete() to remove any table rows matching any arbitrary criteria. You can ignore post ID and meta key columns if you want and just focus on meta values. You can match very elaborate constructs using the REGEXP_LIKE() MySQL function.

    I strongly suggest you first test your criteria in a limited scope in phpMyAdmin using the LIMIT clause before turning it loose on the entire table. Before doing anything, make a backup of your DB. It’s all to easy to inadvertently corrupt your DB using this function. It is extremely powerful and thus extremely dangerous.

Viewing 1 replies (of 1 total)
  • The topic ‘How do I remove all values by brand?’ is closed to new replies.