=== Bulk Delete ===
Contributors: sudar
Tags: post, comment, delete, bulk, mass, draft, revision, page
Requires at least: 3.8
Tested up to: 3.9.1
Donate Link: http://sudarmuthu.com/if-you-wanna-thank-me
Stable tag: 5.2
Bulk delete posts, pages or users in bulk based on different conditions and filters.
== Description ==
**NOTE: v5.0 and the above of this plugin is NOT compatible with any addons whose version is less than v0.5. If you are using an addon for this plugin, then make sure you that you have at least v0.5 or above of the addon before upgrading to v5.0 of this plugin. If you have any questions regarding this, then post them in the [BulkWP support forums][1]**
Bulk Delete is a WordPress Plugin that allows you to delete posts, pages and users in bulk based on different conditions and filters.
The following conditions and filters are supported.
### Features
#### Deleting posts
This Plugin supports the following bulk delete options for deleting posts
- Delete posts by category
- Delete posts by tag
- Delete posts by custom taxonomy
- Delete posts by custom post type
- Delete posts by url
- Delete posts by custom field (Available as a [Pro addon](http://bulkwp.com/addons/bulk-delete-posts-by-custom-field/?utm_source=wprepo&utm_campaign=BulkDelete&utm_medium=readme))
- Delete posts by title (Available as a [Pro addon](http://bulkwp.com/addons/bulk-delete-posts-by-title/?utm_source=wprepo&utm_campaign=BulkDelete&utm_medium=readme))
- Delete posts by duplicate title (Available as a [Pro addon](http://bulkwp.com/addons/bulk-delete-posts-by-duplicate-title/?utm_source=wprepo&utm_campaign=BulkDelete&utm_medium=readme))
- Delete posts by user role (Available as a [Pro addon](http://bulkwp.com/addons/bulk-delete-posts-by-user-role/?utm_source=wprepo&utm_campaign=BulkDelete&utm_medium=readme))
- Delete all draft posts
- Delete all pending posts
- Delete all private posts
- Delete all scheduled posts
- Delete all posts from trash (Available as a [Pro addon](http://bulkwp.com/addons/bulk-delete-from-trash/?utm_source=wprepo&utm_campaign=BulkDelete&utm_medium=readme))
All the above options support the following filters
- Post date greater than X days
- Post date less than X days
- Only public posts
- Only private posts
- Restrict to first N posts
- Delete permanently or just move to trash
- Schedule deletion of posts automatically (Available as a [Pro addon](http://bulkwp.com/addons/?utm_source=wprepo&utm_campaign=BulkDelete&utm_medium=readme))
#### Deleting pages
- Delete all published pages
- Delete all draft pages
- Delete all pending pages
- Delete all private pages
- Delete all scheduled pages
- Delete all pages from trash (Available as a [Pro addon](http://bulkwp.com/addons/bulk-delete-from-trash/?utm_source=wprepo&utm_campaign=BulkDelete&utm_medium=readme))
Like posts, all the above options support the following filters as well
- Post date greater than X days
- Post date less than X days
- Only public posts
- Only private posts
- Restrict to first N posts
- Delete permanently or just move to trash
- Schedule deletion of pages automatically (Available as a [Pro addon](http://bulkwp.com/addons/scheduler-for-deleting-pages-by-status/?utm_source=wprepo&utm_campaign=BulkDelete&utm_medium=readme))
#### Deleting post revisions
- Delete all post revisions
#### Deleting users
- Delete users based on user role
- Delete users who have not logged in in the last X days
#### Deleting posts by content and page views
- Delete duplicate posts by title (Available as a [Pro addon](http://bulkwp.com/addons/bulk-delete-posts-by-duplicate-title/?utm_source=wprepo&utm_campaign=BulkDelete&utm_medium=readme))
More options coming soon :)
As you can see, the Plugin provide comprehensive options and filters to perform bulk deletion.
If you looking for just moving posts, instead of deleting, then use [Bulk Move Plugin][2] instead.
### Pro Addons
The following are the popular pro addons that are available for purchase. The full list of [pro addons](http://bulkwp.com/addons/?utm_source=wprepo&utm_campaign=BulkDelete&utm_medium=readme) is available at the plugin site.
- **Delete posts by custom field** - Adds the ability to delete posts based on custom field. [More details](http://bulkwp.com/addons/bulk-delete-posts-by-custom-field/?utm_source=wprepo&utm_campaign=BulkDelete&utm_medium=readme).
- **Delete posts by title** - Adds the ability to delete posts based on title. [More details](http://bulkwp.com/addons/bulk-delete-posts-by-title/?utm_source=wprepo&utm_campaign=BulkDelete&utm_medium=readme).
- **Delete posts by duplicate title** - Adds the ability to delete posts based on duplicate title. [More details](http://bulkwp.com/addons/bulk-delete-posts-by-duplicate-title/?utm_source=wprepo&utm_campaign=BulkDelete&utm_medium=readme).
- **Delete posts by user role** - Adds the ability to delete posts based on user role. [More details](http://bulkwp.com/addons/bulk-delete-posts-by-user-role/?utm_source=wprepo&utm_campaign=BulkDelete&utm_medium=readme).
- **Delete from trash** - Adds the ability to delete posts and pages from trash. [More details](http://bulkwp.com/addons/bulk-delete-from-trash/?utm_source=wprepo&utm_campaign=BulkDelete&utm_medium=readme).
- **Scheduler for deleting posts Category** - Adds the ability to schedule auto delete of posts based on category. [More details](http://bulkwp.com/addons/scheduler-for-deleting-posts-by-category/?utm_source=wprepo&utm_campaign=BulkDelete&utm_medium=readme).
- **Scheduler for deleting posts Tag** - Adds the ability to schedule auto delete of posts based on tag. [More details](http://bulkwp.com/addons/scheduler-for-deleting-posts-by-tag/?utm_source=wprepo&utm_campaign=BulkDelete&utm_medium=readme).
- **Scheduler for deleting posts by Custom Taxonomy** - Adds the ability to schedule auto delete of posts based on custom taxonomy. [More details](http://bulkwp.com/addons/scheduler-for-deleting-posts-by-taxonomy/?utm_source=wprepo&utm_campaign=BulkDelete&utm_medium=readme).
- **Scheduler for deleting posts by Custom post type** - Adds the ability to schedule auto delete of posts based on custom post type. [More details](http://bulkwp.com/addons/scheduler-for-deleting-posts-by-post-type/?utm_source=wprepo&utm_campaign=BulkDelete&utm_medium=readme).
- **Scheduler for deleting posts by Post Status** - Adds the ability to schedule auto delete of posts based on post status like drafts, pending posts, scheduled posts etc. [More details](http://bulkwp.com/addons/scheduler-for-deleting-posts-by-status/?utm_source=wprepo&utm_campaign=BulkDelete&utm_medium=readme).
- **Scheduler for deleting pages by status** - Adds the ability to schedule auto delete of pages based on status. [More details](http://bulkwp.com/addons/scheduler-for-deleting-pages-by-status/?utm_source=wprepo&utm_campaign=BulkDelete&utm_medium=readme).
- **Scheduler for deleting users by User Role** - Adds the ability to schedule auto delete of users based on user role. [More details](http://bulkwp.com/addons/scheduler-for-deleting-users-by-role/?utm_source=wprepo&utm_campaign=BulkDelete&utm_medium=readme).
### Development
The development of the Plugin happens over at [github][6]. If you want to contribute to the Plugin, fork the [project at github][6] and send me a pull request.
If you are not familiar with either git or Github then refer to this [guide to see how fork and send pull request](http://sudarmuthu.com/blog/contributing-to-project-hosted-in-github).
If you are looking for ideas, then you can start with one of the following TODO items :)
### TODO
The following are the features that I am thinking of adding to the Plugin, when I get some free time. If you have any feature request or want to increase the priority of a particular feature, then let me know.
- Bulk Delete posts based on page views
- Bulk delete based on the presence/absence of a word
- Bulk Delete empty posts
- Bulk delete comments
- Delete images that are used by the posts that are being deleted
- Bulk Delete posts based on users - Added in v5.2
- Bulk Delete sticky posts - Added in v4.4
- Change the message based on the option the user has chosen - Added in v3.3
- Expandable/collapsible taxonomies - Added in v3.3
- Ability to choose the different sections that should be loaded - Added in v3.4
- Bulk Delete by custom post types - Added in v3.5
### Support
- If you have found a bug/issue or have a feature request, then post them in [github issues][7]
- If you have a question about the plugin usage or need help to troubleshoot, then post about it in our [BulkWP Support forums][1]
- If you have a question about any of the addon or need help to troubleshoot the addons, then post about it in our [BulkWP Support forums][1]
- If you like the Plugin, then kindly leave a review/feedback at [WordPress repo page][8]. This will help more people to discover the plugin.
- Checkout other [WordPress Plugins][5] that I have written
- If anything else, then contact us in [twitter][3].
[1]: http://bulkwp.com/support
[2]: http://sudarmuthu.com/wordpress/bulk-move
[3]: http://twitter.com/bulkwp
[5]: http://sudarmuthu.com/wordpress
[6]: https://github.com/sudar/bulk-delete
[7]: https://github.com/sudar/bulk-delete/issues
[8]: http://wordpress.org/support/view/plugin-reviews/bulk-delete
== Translation ==
The Plugin currently has translations for the following languages.
* Dutch (Thanks Rene)
* Brazilian Portuguese (Thanks Marcelo of Criacao de Sites em Ribeirao Preto)
* German (Thanks Jenny Beelens)
* Turkish Portuguese (Thanks Bahadir Yildiz)
* Spanish (Thanks Brian Flores)
* Italian (Thanks Paolo Gabrielli)
* Bulgarian (Thanks Nikolay Nikolov)
* Russian (Thanks Maxim Pesteev)
* Lithuanian (Thanks Vincent G)
* Hindi (Thanks Love Chandel)
* Serbian (Thanks Diana)
* Gujarati (Thanks Puneet)
The pot file is available with the Plugin. If you are willing to do translation for the Plugin, use the pot file to create the .po files for your language and let me know.
== Credits ==
Thanks Martin Capodici for providing the code to implement the "delete specific page" feature.
Thanks to [Time picker addon](http://trentrichardson.com/examples/timepicker/) JavaScript library, which the Plugin uses.
== Installation ==
Extract the zip file and just drop the contents in the wp-content/plugins/ directory of your WordPress installation and then activate the Plugin from Plugins page.
== Frequently Asked Questions ==
= After installing the Plugin, I just see a blank page. =
This can happen if you have huge number of posts and your server is very underpowered. Check your PHP error log to see if there are any errors and correct them. The most common problems are script timeout or running out of memory. Change your PHP.ini file and increase the script timeout and/or amount of memory used by PHP process.
In particular try to change the following settings
* `max_execution_time = 600` - Maximum execution time of each script, in seconds
* `max_input_time = 30` - Maximum amount of time each script may spend parsing request data
* `memory_limit = 256M` - Maximum amount of memory a script may consume
You can also try to disable different sections of the Plugin, if you have huge number of posts.
= How do I disable different sections of the Plugin =
You can enable or disable different sections of the Plugin by choosing the required modules in the screen option. You can open screen options by clicking the link in the top right corner of the Plugin page.
= How do I know what are the current values for these options configured in my server? =
Scroll down to the button of the Plugin page and you can see the current values of these options printed for your reference under the “Debug Information” heading
= Is it possible to restore the posts that I have deleted through the Plugin? =
If you choose the option "Move to trash" then you can find them from trash. But if you choose "Delete permanently", then it is not possible to retrieve the posts. So be **very careful**.
= Is it possible that some Plugin are not compatible with Bulk Delete? =
Yes. If a Plugin rewrites the query vars by using `add_filter( 'pre_get_posts' )` then it may be incompatible with this Plugin. [The event calendar](http://wordpress.org/plugins/the-events-calendar/) is one such Plugin.
I currently disable and enable the `pre_get_posts` filter if I find that "The event calendar" Plugin is installed. It is not ideal, but it gets the work done. If you find any other Plugin with which Bulk Delete doesn't work, then let me know and I will try to see if I can add support through some hack like this.
= Is it possible to schedule deletion of posts? =
The ability to schedule deletion of posts is available as a [pro addon](http://bulkwp.com/addons/?utm_source=wprepo&utm_campaign=BulkDelete&utm_medium=readme).
= I have a question about the pro addons, how should I contact you? =
You can contact us by posting about it in our [support forum](http://bulkwp.com/support/?utm_source=wprepo&utm_campaign=BulkDelete&utm_medium=readme).
== Screenshots ==
1. The above screenshot shows how you can delete Posts by post status. You can choose between drafts, pending posts, scheduled posts, privates posts.
2. The above screenshot shows how you can delete posts by category.
3. The above screenshot shows how you can delete posts by tag.
4. The above screenshot shows how you can delete posts by custom taxonomy.
5. The above screenshot shows how you can delete posts by post type.
6. The above screenshot shows how you can delete pages by post status. You can choose between draft pages, pending pages, scheduled pages and privates pages.
7. The above screenshot shows how you can delete users by user role.
8. The above screenshot shows how you can schedule auto delete of posts. Note that this feature is available only when you buy [pro addons](http://bulkwp.com/addons/?utm_source=wprepo&utm_campaign=BulkDelete&utm_medium=readme).
9. The above screenshot shows how you can enable/disable different sections of the Plugin.
== Readme Generator ==
This Readme file was generated using wp-readme, which generates readme files for WordPress Plugins.
== Changelog ==
= 2014-07-03 - v5.2 - (Dev time: 8 hours) =
- New: Ability to delete users in batches (Issue #47)
- New: A new addon to delete posts based on users (Issue #6)
= 2014-06-14 - v5.1 - (Dev time: 8 hours) =
- New: Added the "Delete posts from trash" addon (Issue #65)
- Tweak: Added `EMPTY_TRASH_DAYS` to system info page (Issue #67)
- Tweak: Change the contextual help content for admin screens (Issue #68)
- Bug: Added compatibility for PHP version 5.2.4 (Issue #66)
- Bug: Fixed a bug in JavaScript validation in "Delete by URL" module (Issue #69)
= 2014-06-12 - v5.0.2 - (Dev time: 1 hours) =
- Bug: Added compatibility for PHP version 5.2.4 (Issue #64)
= 2014-06-10 - v5.0.1 - (Dev time: 1 hours) =
- Fix: Deleting users had as issue that was introduced in v5.0
= 2014-06-10 - v5.0 - (Dev time: 60 hours) =
- New: Add the ability to delete posts by duplicate title (#56)
- Tweak: Make Bulk_Delete class singleton
- Tweak: Move all deprecated functions and code to a separate file
- New: Add a new page that displays system information for debugging
- Tweak: Add the ability to filter text displayed in admin footer
- Tweak: Change the menu text for Schedule page
- Tweak: Move delete page modules to a separate page
- New: Add the ability to handle addon license
- Tweak: Refactored the way request was handled
- New: Use `add_settings_error` method to display information to users
- Tweak: Update screenshots
- Tweak: Handle expired license properly
= 2014-01-26 - v4.4.3 - (Dev time: 1.5 hours) =
- Tweak: Ability to delete posts from non-public post types as well
- Fix: Fix the height of the sidebar
= 2014-01-05 - v4.4.2 - (Dev time: 1.5 hours) =
- Fix: Deleting first x posts deletes all posts while deleting by category (#44)
- Fix: Posts are moved to trash even if "Delete permanently" option is selected (#45)
- Tweak: Move request processing code for deleting by custom field to addon
= 2013-12-18 - v4.4.1 - (Dev time: 0.5 hours) =
- Fix: Bulk Delete menu overrides other menus at the same position
= 2013-12-14 - v4.4 - (Dev time: 10 hours) =
- New: Ability to delete all published posts from "Post Status" module
- New: Ability to delete all sticky posts from "Post Status" module
- Tweak: Moved all option page to a separate top menu
- Fix: Fix undefined notices and strict warnings
- New: Ability to delete posts by title
- Tweak: Tweak UI for WordPress 3.8
= 2013-12-08 - v4.3 - (Dev time: 2 hours) =
- New: Ability to delete custom post type posts by categories
- New: Ability to delete custom post type posts by custom taxonomy
- Fix: Fix link to "Custom Field" Addon
= 2013-11-11 - v4.2.2 - (Dev time: 1 hour) =
- Fix: Bug in deleting custom post types with hypen
= 2013-11-07 - v4.2.1 - (Dev time: 0.5 hours) =
- Explicitly mark static methods as static
= 2013-10-22 - v4.2 - (Dev time: 3 hours) =
- Add the ability to custom post type posts by post status
= 2013-10-12 - v4.1 - (Dev time: 6 hours) =
- Add the "delete by custom field" pro addon
= 2013-10-07 - v4.0.2 - (Dev time: 1 hours) =
- Fix issue in displaying meta boxes
- Show taxonomy label instead of slug
- Fix issue in deleting posts by custom taxonomy
= 2013-09-12 - v4.0.1 - (Dev time: 1 hours) =
- Fix JavaScript bug that prevented deleting posts by days and in batches
= 2013-09-09 - v4.0 - (Dev time: 25 hours) =
- Add the ability to delete users
- Move menu items under tools
= 2013-07-07 - v3.6.0 - (Dev time: 2 hours) =
- Change minimum requirement to WordPress 3.3
- Fix compatibility issues with "The event calendar" Plugin
= 2013-06-01 - v3.5 - (Dev time: 10 hours) =
- Added support to delete custom post types
- Added Gujarati translations
- Ignore sticky posts when deleting drafts
= 2013-05-22 - v3.4 - (Dev time: 20 hours) =
* Incorporated Screen API to select/deselect different sections of the page
* Load only sections that are selected by the user
= 2013-05-11 - v3.3 - (Dev time: 10 hours) =
* Enhanced the deletion of posts using custom taxonomies
* Added the ability to schedule auto delete of taxonomies by date
* Cleaned up all messages that are shown to the user
* Added on screen help tab
= 2013-05-04 - v3.2 - (Dev time: 20 hours) =
* Added support for scheduling auto delete of pages
* Added support for scheduling auto delete of drafts
* Fixed issue in deleting post revisions
* Move post revisions to a separate section
* Better handling of post count to improve performance
* Moved pages to a separate section
* Added ability to delete pages in different status
* Added the option to schedule auto delete of tags by date
* Fixed a bug which was not allowing categories to be deleted based on date
= 2013-04-28 - v3.1 - (Dev time: 5 hours) =
* Added separate delete by sections for pages, drafts and urls
* Added the option to delete by date for drafts, revisions, future posts etc
* Added the option to delete by date for pages
= 2013-04-27 - v3.0 - (Dev time: 10 hours) =
* Added support for pro addons
* Added GUI to see cron jobs
= v2.2.2 (2012-12-20) (Dev time: 0.5 hour) =
* Removed unused wpdb->prepare() function calls
= v2.2.1 (2012-10-28) (Dev time: 0.5 hour) =
* Added Serbian translations
= v2.2 (2012-07-11) (Dev time: 0.5 hour) =
* Added Hindi translations
* Added checks to see if elements are present in the array before accessing them.
= v2.1 (2012-04-07) Dev Time: 1 hour =
* Fixed CSS issues in IE
* Added Lithuanian translations
= v2.0 (2012-04-01) Dev Time: 10 hours =
* Fixed a major issue in how dates were handled.
* Major UI revamp
* Added debug information and support urls
= v1.9 (2012-03-16) =
* Added support for deleting by permalink. Credit Martin Capodici
* Fixed issues with translations
* Added Russian translations
= v1.8 (2012-01-31) =
* Added roles and capabilities for menu
= v1.7 (2012-01-12) =
* Added Bulgarian translations
= v1.6 (2011-11-28) =
* Added Italian translations
= v1.5 (2011-11-13) =
* Added Spanish translations
= v1.4 (2011-08-25) =
* Added Turkish translations
= v1.3 (2011-05-11) =
* Added German translations
= v1.2 (2011-02-06) =
* Added some optimization to handle huge number of posts in underpowered servers
= v1.1 (2011-01-22) =
* Added support to delete posts by custom taxonomies
* Added Dutch Translation
* Added Brazilian Portuguese Translation
= v1.0 (2010-06-19) =
* Proper handling of limits.
= v0.8 (2010-03-17) =
* Added support for private posts.
= v0.7 (2010-02-21) =
* Added an option to delete posts directly or send them to trash.
* Added support for translation.
= v0.6 (2009-07-22) =
* Added option to delete all scheduled posts.
= v0.5 (2009-07-21) =
* Added option to delete all pending posts.
= v0.4 (2009-07-05) =
* Added option to delete by date.
= v0.3 (2009-04-05) =
* Prevented drafts from deleted when only posts are selected
= v0.2 (2009-02-03) =
* Fixed issues with paging
= v0.1 (2009-02-02) =
* First version
== Upgrade Notice ==
= 5.2 =
Ability to delete users in batches and a new addon to delete posts based on users
= 5.1 =
Added the ability to delete posts and pages from trash
= 5.0.2 =
Added compatibility for PHP version 5.2.4
= 5.0.1 =
Fix delete users. Note: This version is only compatible with addons above v0.5
= 5.0 =
This version is only compatible with addons above v0.5
= 4.4.1 =
Fix: Prevent Bulk Delete from overriding other menus
= 4.2.2 =
Fix: Bug in deleting custom post types with hypen
= 4.2.1 =
Fix warning message in PHP 5.2.x
= 4.2 =
Add the ability to custom post type posts by post status
= 4.0.2 =
Fixed issue in deleting posts by custom taxonomy
= 4.0.1 =
Fixed JS bug that was introduced in v4.0
= 4.0 =
Add the ability to delete users
= 3.6.0 =
Fix compatibility issues with "The event calendar" Plugin
= 3.5 =
Added the ability to delete posts by custom post types.
= 3.4 =
Added the ability to disable different sections of the Plugin.
= 3.3 =
Fixed issues in deleting posts using custom taxonomy
= 3.2 =
Fixed bugs in handling post revisions and dates in categories. Added more options to delete pages.
= 3.1 =
Added the option to delete by date for pages, drafts, revisions, future posts etc