Bulk Redirect Manager
This module allows site administrators to import, export, and manage URL redirects in bulk using CSV, JSON, XML, or Excel files. It includes features like validation before import, a preview of changes, batch processing for large datasets, and the ability to roll back any import.
Introduction
Bulk Redirect Manager enables site administrators to efficiently import, export, and manage large collections of URL redirects using the Redirect module. Instead of creating redirects individually through the Redirect UI, administrators can work with CSV, JSON, XML, or Excel files from a single interface.
Before any changes are applied, every record is validated and compared against existing redirects. An optional preview displays exactly which redirects will be created, updated, skipped, or rejected, together with the reason for each outcome. A dry-run mode allows the entire import to be validated without modifying site data. Large imports are processed using Drupal's Batch API to ensure reliable execution, and every completed import can be rolled back. Newly created redirects are removed during rollback, while overwritten redirects are restored to their original values.
Project Summary
Bulk Redirect Manager provides a reliable redirect management workflow with comprehensive validation, preview-before-import, batch processing, and full rollback support, making it suitable for both small and enterprise-scale redirect migrations.
Features
- Import redirects from CSV, JSON, XML, and Excel (.xlsx) files with support for common header aliases such as
from/to,old_url/new_url,status/code, andlangcode. - Comprehensive row-level validation including required fields, internal source path validation, redirect loop detection, supported HTTP status codes (300–308), and duplicate detection within the import file.
- Configurable conflict handling for existing redirects, allowing administrators to create new redirects, overwrite existing ones, or skip conflicting entries according to site settings.
- Optional preview mode that displays the result of every imported row before execution, along with a dry-run option for validation without making any database changes.
- Batch processing for imports, exports, and rollback operations using Drupal's Batch API with configurable processing sizes for reliable handling of large datasets.
- Export redirects to CSV, JSON, XML, or Excel formats with optional filtering by status code, language, or enabled status.
- Complete rollback support that restores overwritten redirects to their previous source, destination, status code, language, and enabled state, while removing redirects created during the import.
- Import and export history with detailed statistics, including created, updated, skipped, and failed records, together with rollback availability.
Post-Installation
After installing the module:
-
Navigate to People → Permissions and assign the appropriate permissions:
Import Redirects,
Export Redirects,
Rollback Redirect Imports,
View Redirect Reports, or
Administer Bulk Redirect Manager for complete administrative access. -
Go to Configuration → Search and metadata → Bulk Redirect Manager
(/admin/config/search/bulk-redirect-manager) to configure upload limits, supported file types, batch size, default redirect status code, preview and dry-run behavior, conflict handling, duplicate handling, external destination support, and history logging. - Open the Import tab, upload a supported file, review the preview (if enabled), and confirm the import.
- Previous imports can be reviewed or reverted at any time from the Rollback and Report tabs.
Additional Requirements
- Drupal 10.3 or Drupal 11
- Redirect module
phpoffice/phpspreadsheet(installed automatically through Composer) for Excel import and export support
Similar Projects
Several Drupal projects provide redirect import and export functionality. Most focus primarily on converting file data directly into redirect entities. Bulk Redirect Manager extends that workflow with enterprise-oriented capabilities including row-level validation, configurable conflict resolution, preview-before-import, dry-run validation, detailed reporting, and complete rollback support.
Redirect Bulk addresses a different use case by allowing administrators to manually enter multiple redirects from a single form. It is intended to simplify manual redirect creation rather than automate bulk migrations. Bulk Redirect Manager, in contrast, is designed for importing, exporting, validating, and safely managing hundreds or thousands of redirects from structured files.
Supporting this Module
Bug reports, feature requests, patches, and documentation improvements are welcome through the Drupal.org issue queue. Community contributions are encouraged.
Community Documentation
Comprehensive documentation is available in the project's README, including supported file formats, validation rules, conflict resolution options, import workflow, rollback behavior, and configuration details.
Permissions
- Import Redirects – Import redirect files.
- Export Redirects – Export existing redirects.
- Rollback Redirect Imports – Restore a previous import batch.
- View Redirect Reports – Access import and export history.
- Administer Bulk Redirect Manager – Full administrative access, including configuration.
Architecture
- ParserInterface with dedicated CsvParser, JsonParser, XmlParser, and ExcelParser implementations, all sharing
RowNormalizerTraitto normalize different file formats into a consistent redirect structure. - Validator performs row-level validation including required fields, internal path validation, redirect loop detection, supported status codes, duplicate detection, and language validation.
- ConflictResolver determines whether each validated redirect should be created, updated, or skipped based on existing redirects and administrator-defined conflict handling rules.
- RedirectImporter coordinates parsing, validation, conflict resolution, preview generation, Batch API processing, and rollback logging.
- RedirectExporter retrieves redirects, applies optional filters, and generates downloadable export files in supported formats.
- RollbackManager restores overwritten redirects to their original state while removing redirects created during an import.
- ImportForm, ExportForm, RollbackForm, SettingsForm, and ReportController provide the administrative interface, including the upload → preview → confirm import workflow.
Bulk Redirect Manager is fully compatible with Drupal 10.3 and Drupal 11 and follows Drupal best practices for scalability, reliability, and maintainability.