A Django management command to import images from a WordPress XML export into Wagtail.
pip install wagtail-wordpress-image-importerAdd to your INSTALLED_APPS in Django settings:
INSTALLED_APPS = [
...
'wagtail_wordpress_image_importer',
...
]Export your WordPress content as XML from WordPress admin (Tools > Export).
Then run:
python manage.py import_wordpress_images /path/to/your/wordpress-export.xml--debug: Show detailed debug information during import--collection: Import images into specified collection--delete-existing: Delete all existing Wagtail images before importing (for specified collection, if provided)
MIT License
# Clone the repository
git clone git@github.com:tomdyson/wagtail-wordpress-image-importer.git
cd wagtail-wordpress-image-importer
# Create and activate a virtual environment
python -m venv .venv
source .venv/bin/activate # or `.venv\Scripts\activate` on Windows
# Install dependencies
pip install -e .- Update the version number in
pyproject.toml - Commit your changes
- Create and push a new tag:
git tag v0.1.1 git push origin v0.1.1
- Create a new release on GitHub using this tag
- The GitHub Action will automatically build and publish to PyPI