Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/braudypedrosa/bulk-image-scanner/archive/refs/heads/master.zipA WordPress plugin to scan all post content for image URLs and replace them individually or in bulk. Import images to the Media Library and update post content URLs.
Features
- Batch Scanning: Scan all posts and pages for external image URLs
- Live Progress: Real-time progress bar during scanning and importing
- Individual Import: Import single images to Media Library with one click
- Bulk Import: Import all found images at once
- Smart Detection: Automatically skips images already in Media Library
- URL Pattern Filtering: Filter images by URL pattern (e.g.,
https://example.com/uploads/) - 404 Detection: Option to exclude images that return 404 errors
- Post Type Support: Choose which post types to scan
- File Type Filtering: Configure allowed image extensions
- Modern UI: Clean, responsive interface with SweetAlert2 notifications
Installation
From Source (Development)
- Clone or download this repository
- Install dependencies:
npm install - Build the plugin:
npm run build - The plugin zip file will be created in
bundled/1.0.0/bulk-image-scanner.zip - Upload the zip file to your WordPress site via Plugins > Add New > Upload Plugin
Manual Installation
- Upload the plugin files to
/wp-content/plugins/bulk-image-scanner/ - Activate the plugin through the 'Plugins' menu in WordPress
- Navigate to 'Bulk Image Scanner' in the admin menu
Usage
- Scan for Images: Enter a URL pattern (optional) and click "Scan"
- Review Results: View all found images in a sortable table
- Import Images:
- Click "Import to Media Library" for individual images
- Click "Import All" to import all images at once
- Monitor Progress: Watch the progress bar and status messages
- Configure Settings: Adjust allowed extensions and post types in the Settings tab
Configuration
Allowed Image Extensions
Default: jpg,jpeg,png,webp
Post Types to Scan
Default: Posts and Pages
URL Pattern Filtering
Examples:
https://example.com/uploads/- Only images from this domain/pathhttps://cdn.example.com/- Only images from CDN- Leave empty to scan all image URLs
Development
Building the Plugin
# Install dependencies
npm install
# Build the plugin
npm run build
# Clean build directory
npm run clean
File Structure
bulk-image-scanner/
├── assets/
│ ├── bulk-image-scanner.css
│ └── bulk-image-scanner.js
├── includes/
│ ├── class-bis-actions.php
│ ├── class-bis-admin.php
│ ├── class-bis-scan-table.php
│ ├── class-bis-scan.php
│ └── class-bis-settings.php
├── bulk-image-scanner.php
├── build.js
├── package.json
└── README.md
Key Features Explained
Smart Media Library Detection
The plugin checks if an image is already in the Media Library before attempting to import it, preventing duplicate imports and saving time.
Batch Processing
Uses AJAX batch processing to handle large numbers of posts efficiently without timeouts.
Error Handling
Comprehensive error handling for network issues, file type validation, and WordPress integration.
Requirements
- WordPress 5.0 or higher
- PHP 7.4 or higher
- JavaScript enabled in browser
- Admin privileges
Changelog
Version 1.0.0
- Initial release
- Batch scanning functionality
- Individual and bulk import
- Smart Media Library detection
- Modern UI with SweetAlert2
- Configurable settings
License
This plugin is licensed under the GPL v2 or later.
Support
For support, please create an issue on the GitHub repository or contact the developer.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
Credits
- SweetAlert2: Beautiful, responsive, customizable replacement for JavaScript's popup boxes
- DataTables: Advanced interaction controls for HTML tables
- WordPress: The world's most popular CMS