How to recover expired vehicles

The following tutorial will show you how to recover vehicles once they are expired.
Note: vehicles will not expire for no reason. Vehicles will ONLY expire when you set the option into the Theme Options Panel, or when the vehicle has been added through a package which has an expiration date attached.

Before following this tutorial, make sure you make a backup of your MYSQL database, in case anything goes wrong. Again, make a backup.

The easiest way to retrieve all the vehicles again, is to use the following SQL query.

1) Login through phpmyadmin into your hosting or with any other tool to manage your database tables.

2) Locate the database of your WordPress setup.

3) Click the “SQL” button at the top of your screen.

4) And paste the following in it. ( Make sure you have a backup before running the query)

 

SELECT * FROM wp_posts WHERE post_type='vehicles';  UPDATE wp_posts SET post_status = replace(post_status, 'preview', 'publish') WHERE post_status='preview';  UPDATE wp_posts SET post_status = replace(post_status, 'expired', 'publish') WHERE post_status='expired';

You should now be able to see all the vehicles again into your wp-dashboard. Note that now all the vehicles are set as published.

If you wish to completely remove the expiration date from previously listed vehicles please keep on reading.

1) Login through phpmyadmin into your WordPress database setup.

2) Locate the database of your setup.

3) Locate the table called wp_postmeta

4) Click the “Search” button a the top of your screen.

5) Locate the “meta_key” row and into the “value” input field, type this (screenshot here http://cl.ly/WRsg )

 

_auto_expires

6) You should now see a list of results of all the vehicles and their expiration date.

7) Click the “SQL” button and type the following in it (make sure you have a backup of your database first)

 

UPDATE wp_postmeta SET meta_value ='' WHERE meta_value IS NOT NULL AND meta_key='_auto_expires'

8) Done, your vehicles do not have an expiration date anymore.

Regards.