1

Is it possible to delete a huge number of wordpress posts through SQL query using phpmyadmin by using a permalink list of posts that I want to delete ?

2 Answers 2

1

Yes you can. To delete posts with inherit post meta, use following code:

DELETE
p,pm
FROM wp_posts p
JOIN wp_postmeta pm ON pm.post_id = p.id
WHERE p.post_name IN ('post-1', 'post-2', 'post-3')

Pass slugs array to WHERE clause.

If you want to delete only posts w/out postmeta (for some reason), use this code:

DELETE
FROM wp_posts
WHERE post_name IN ('post-1', 'post-2', 'post-3')
0

It depends on permalinks. Permalinks can contain more then just the post name (slug). Also, post names don't have to be unique. So, it is possible, but it depends on many other factors.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.