Reset WordPress?

Jack London

New member
Joined
Jul 9, 2012
Messages
386
Points
0
Hello!
I wonder if there is any way to clear all the posts in a WordPress blog, other than clicking Delete on every single one.
method 1:
Login to your phpmyAdmin and running queries on database you want to remove wordpress posts

Code:
SELECT *
FROM wp_posts a
LEFT JOIN wp_term_relationships b ON ( a.ID = b.object_id )
LEFT JOIN wp_postmeta c ON ( a.ID = c.post_id )
LEFT JOIN wp_term_taxonomy d ON ( d.term_taxonomy_id = b.term_taxonomy_id )
LEFT JOIN wp_terms e ON ( e.term_id = d.term_id )
WHERE e.term_id =<category id>
now you selected records that you will delete, continue running code

Code:
delete a,b,c,d
FROM wp_posts a
LEFT JOIN wp_term_relationships b ON ( a.ID = b.object_id )
LEFT JOIN wp_postmeta c ON ( a.ID = c.post_id )
LEFT JOIN wp_term_taxonomy d ON ( d.term_taxonomy_id = b.term_taxonomy_id )
LEFT JOIN wp_terms e ON ( e.term_id = d.term_id )
WHERE e.term_id =<category id>
replace <category id> above by your category id having posts in it ( you will delete posts in this categories )

method 2:
Code:
delete FROM wp.wp_terms;
delete FROM wp.wp_term_taxonomy;
delete FROM wp.wp_term_relationships;
delete FROM wp.wp_posts;
delete FROM wp.wp_postmeta ;

method 3:
simple to remove posts but information still exist on other tables like terms, taxomony, relationship...
Here's code:

Code:
DELETE FROM `wp_posts`
WHERE  `post_type` =  'prefix-numberplates'
LIMIT 0 , 10000
Hope you will choose one of ways above and it's useful to you.!!
 
Older threads
Replies
5
Views
3,572
Replies
5
Views
2,588
Replies
1
Views
2,861
Replies
1
Views
2,082
Newer threads
Replies
3
Views
2,537
Replies
16
Views
7,031
Replies
2
Views
4,491
Replies
1
Views
2,422
Latest threads
Replies
1
Views
58
Replies
0
Views
81
Replies
0
Views
146
Replies
2
Views
361
Recommended threads
Replies
2
Views
999
Replies
1
Views
2,421
Replies
7
Views
4,097
Replies
7
Views
6,607

Latest postsNew threads

Referral contests

Referral link for :

Sponsors

Popular tags

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top