=== Bulk Trash by URL ===
Contributors: ivantrendafilov
Tags: bulk delete, trash, urls, posts, pages
Requires at least: 5.8
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 1.1
Text Domain: bulk-trash-by-url
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Bulk‑trash posts, pages and custom post types from pasted URLs. Fast URL mapping, batched processing with pause/resume, and an optional summary.

== Description ==

Bulk Trash by URL helps editors and SEOs quickly clean up content by trashing items based on a list of URLs. Paste your URLs, let the plugin map each URL to a post ID (handles common variations like trailing slashes and marketing query params), select what you want to remove, and process in efficient batches with progress feedback.

Key features:

- Paste URLs to find matching posts, pages, and custom post types.
- Fast URL-to-post mapping in AJAX batches with progress bar.
- Select exactly which items to trash before running.
- Batched trashing with live progress, pause/resume controls.
- Optional completion summary with counts and lists (trashed, failed, no permission, invalid).
- Settings to tune performance and limits:
  - Max Page Size (mapping batch size)
  - Max URLs per run
  - Toggle completion summary
  - Optional mode to set matched items to Private instead of Trash

Built for large lists and long-running jobs. Everything goes to the WordPress Trash, so you can restore or permanently delete as you normally would.

Capabilities & security:

- Restricted to users who can `manage_options`.
- Nonce-protected AJAX endpoints.
- Conservative sanitization and server-side validation.

Compatibility notes:

- Works with sites using pretty permalinks. Mapping relies on WordPress `url_to_postid()` and common URL variants.
- Custom post types are supported if they use public, front-end URLs.

== Installation ==

1. Upload the plugin files to `/wp-content/plugins/bulk-trash-by-url/`, or install from the Plugins screen.
2. Activate the plugin through the “Plugins” screen in WordPress.
3. Go to Tools → Bulk Trash by URL.
4. Paste URLs (one per line), click “Find Items”, review the matched items, and start trashing.

== Frequently Asked Questions ==

= Will this permanently delete my posts? =

No. Items are moved to the WordPress Trash. You can restore or permanently delete them from there.

= Does it support custom post types? =

Yes, provided the post type is public and has front-end URLs that `url_to_postid()` can resolve.

= What happens if a URL doesn’t map to a post? =

Unmatched URLs are listed after the mapping phase so you can review and resolve them.

= I get timeouts. What can I do? =

Reduce “Max Page Size” in Settings to make each AJAX batch smaller. You can also lower “Max URLs per run”.

= Who can use the tool? =

Only administrators (users with `manage_options`) can access it.

== Screenshots ==

1. Paste URLs and click “Find Items”.
2. Mapping progress with unmatched URLs preview.
3. Select items to trash and monitor progress.
4. Settings: adjust page size, max URLs, and summary.

== Changelog ==

= 1.1 =
- New option: set matched items to Private instead of moving them to the Trash (disabled by default).

= 1.0 =
- Initial release under the new name.
- Two-step flow with URL mapping, selection, and batched trashing with pause/resume.
- Summary screen with detailed results.
- Settings tab for Mapping Batch Size, Max URLs per run, and summary toggle.
- Performance improvements for large lists.

== Upgrade Notice ==

= 1.0 =
Initial release on WordPress.org as “Bulk Trash by URL”.
