Restore media attachments using WP CLI. Based on download missing attachments with support for custom content directory and configuration in WP CLI config file.
If you're using WP-CLI v0.23.0 or later, you can install this package with:
wp package install frozzare/wp-cli-media-restore
Or, using Composer directly:
composer require frozzare/wp-cli-media-restore
For other methods, please refer to WP-CLI's Community Packages wiki.
Example of ~/.wp-cli/config.yml
:
media:
restore:
generate: false
uploads_url: http://www.bedrock.com/app/uploads/
Set this optional parameter if you want to (re)generate all the different image sizes. Defaults to not generating thumbnails.
The URL to the uploads directory, not including any date based folder structure.
wp media restore --uploads-url=http://www.bedrock.com/app/uploads/
MIT © Fredrik Forsmo