• Resolved USREC

    (@hawaiirealestate)


    We have Estatik Remove Properties Plugin, but way too slow… we have over 10,000 properties, Estatik plugin will takes hours to complete.

    Need Faster method.

    What is SQL Script to remove ALL properties from DB?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Estatik

    (@estatik)

    Hello,
    Please try the following script for the DB:
    DELETE FROM wp_posts WHERE post_type=’properties’;
    DELETE FROM wp_postmeta WHERE post_id NOT IN (SELECT id FROM wp_posts);
    DELETE FROM wp_term_relationships WHERE object_id NOT IN (SELECT id FROM wp_posts)
    IF you use PHP code, try the following request:
    $allposts= get_posts( array(‘post_type’=>’properties’,’numberposts’=>-1) );
    foreach ($allposts as $eachpost) {
    wp_delete_post( $eachpost->ID, true );
    }
    Please note that the great amount of listings can cause timeout error of the server with these requests.
    I should note that we do not recommend to delete the listings from the DB directly. This kind of deletion will leave some listings data on the server.
    Please make sure you have full website backup before any changes on it.
    Thanks.

    Thread Starter USREC

    (@hawaiirealestate)

    GET SQL ERROR
    #1054 – Unknown column ‘’properties’’ in ‘where clause’

    Thread Starter USREC

    (@hawaiirealestate)

    wp_posts does not contain post_type=’properties’

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘SQL Script to remove ALL properties from DB’ is closed to new replies.