How to bulk delete in wordpress posts, pages, Media Images, tags and categories

How to bulk delete in wordpress posts, pages, Media Images, tags and categories

bulk delete wordpress media Images  from database

go to phpmyadmin and locate your database run sql query below by click sql paste this code one by one.

  1. # First:
  2. DELETE FROM wp_postmeta
  3. WHERE post_id IN
  4. (
  5. SELECT id
  6. FROM wp_posts
  7. WHERE post_type = ‘attachment’
  8. )
  9. ;
  10. # Second:
  11. DELETE FROM wp_posts WHERE post_type = ‘attachment’

How to delete only Unattached wordpress mediafiles?

 Really I don’t Know How to identify Unattached and attached media.
These Media attachments are like post or pages. so

How i deleted unattached media files in from wordpress database?

i tried to delete wordpress attachments from wordpress media dashboard but i am able to delete only 22 attachments at a time. but there are more than 2700 attachments which are imported from blogger/ blogspot image while i am moving blogger wordpress in the year 2012.
also there is a issued wp-post meta data also same as blogger when the wordpress updates sometime old permalinks will appears. and guid also as blogger permalink. we need fix this.
let’s go to the point 
Go sql query in phpmyadmin enter this code 
  1. DELETE FROM wp_posts WHERE post_type = ‘attachment’

choose modified date Ascending order or Descending order increase the rows to view 25 to 500 .also check post title while you are deleting the attachments.

That’s I did. i tried wp-media cleaner plugin not worked.

How to bulk delete posts,pages, tags in wordpress?


If you want delete bulk posts, pages, tags, categories use wp-mass delete or bulk delete plugin.


delete post meta data from database which is unused?

simply run this query

below this will delete unused post meta data from wordpress database thorough phpmyadmin.


DELETE pm
FROM wp_postmeta pm
LEFT JOIN wp_posts wp ON wp.ID = pm.post_id
WHERE wp.ID IS NULL;



Delete All tags in wordpress

We can delete by sql query also from these 2 other plugins.

delete unused tags plugin updated on 2013

My blog have 2.203 tags I want to delete all of them. but below 2nd mass delete plugin may cause problem with wordpress.just faced functions.php error with wordpress managed hosting godaddy.
Finally i have used unused tags wp plugin and deleted all wp tags of unattached now i am only have 857 tags. which are not indexed by google. know more about tags & categories with google.
Mass delete tags plugin not updated from 2 years.also not compatible with present version wordpress.


Also look at wordpress duplicate content

Note use this Carefully and backup your database before this.