wp media <command>

Import new attachments or regenerate existing ones.

EXAMPLES EXAMPLES

# Re-generate all thumbnails, without confirmation.
$ wp media regenerate --yes
Found 3 images to regenerate.
1/3 Regenerated thumbnails for "Sydney Harbor Bridge" (ID 760).
2/3 Regenerated thumbnails for "Boardwalk" (ID 757).
3/3 Regenerated thumbnails for "Sunburst Over River" (ID 756).
Success: Regenerated 3 of 3 images.

# Import a local image and set it to be the featured image for a post.
$ wp media import ~/Downloads/image.png --post_id=123 --title="A downloaded picture" --featured_image
Success: Imported file '/home/person/Downloads/image.png' as attachment ID 1753 and attached to post 123 as featured image.

Top ↑

SUBCOMMANDS SUBCOMMANDS

Name Description
wp media import

Create attachments from local files or URLs.

wp media regenerate

Regenerate thumbnails for one or more attachments.

Command documentation is regenerated at every release. To add or update an example, please submit a pull request against the corresponding part of the codebase.