TRUNCATE LISTINGS

Discussion in 'GeoCraft WordPress Theme' started by joaquin, Sep 13, 2013.

  1. joaquin

    joaquin New Member

    Joined:
    Sep 9, 2013
    Messages:
    9
    Likes Received:
    0
    How can I delete all listings in my database, but without deleting the categories ????

    I had a problem importing the csv, and I have to delete all records

    Besides importing the csv appears blank category or new categories ,will be a problem in truth csv ????

    THANKS!
     
  2. Nitesh

    Nitesh Support Staff

    Joined:
    Oct 19, 2012
    Messages:
    5,165
    Likes Received:
    160
    Hello,

    You can remove listings through
    Dashboard > Business listings
    After that upload csv again there is no need to leave category field empty in the csv file.
    Just upload it as it is. All your old categories will overwrite and new will be uploaded.
     
  3. joaquin

    joaquin New Member

    Joined:
    Sep 9, 2013
    Messages:
    9
    Likes Received:
    0
    Yes, but I have 1800 listings and only can delete 20 each time!
     
  4. joaquin

    joaquin New Member

    Joined:
    Sep 9, 2013
    Messages:
    9
    Likes Received:
    0
    I can truncate the database from my server dasboard, but wich tables I have to truncate to remove all locations ? because I see that the locations information is organized in multiple tables
     
  5. Gourav

    Gourav Support Staff

    Joined:
    Oct 19, 2012
    Messages:
    7,728
    Likes Received:
    207
    Hello,

    Go to function.php present in your theme directory and add the code given below

    Code:
    global $wpdb;
    $wpdb->query("DELETE FROM $wpdb->posts WHERE post_type='listing' and post_status='publish'");
    
    Sending image for reference

    2013-09-14_1610.png


    Firstly save that code in the bottom of function.php file and then refresh your dashboard and website, It will delete your all publish listings after that remove that code and again save your file.
     

Share This Page