If you use the --skip=image_resize
option with the wp-import
WP-CLI command, it will indeed skip the time-consuming thumbnail generation during the import process. However, this doesn’t mean you’ll have to manually set the Featured Image for every imported post. Here’s how it typically works:
- Using
wp-import
with --skip=image_resize
: By using this option, you are bypassing the creation of multiple image sizes (thumbnails) for each imported image during the import. This speeds up the import process but may result in missing or unoptimized thumbnails for featured images.
- Running
wp media regenerate --yes
: After the import, you can run wp media regenerate --yes
to generate the missing image sizes/thumbnails for the imported media. This command regenerates the image sizes based on your WordPress theme’s settings and the image size configurations set in your WordPress installation.
- Featured Images: After you run
wp media regenerate
, the featured images of your imported posts should be set as they were on the site that was exported to the WXR file. The regeneration process should create the necessary thumbnail sizes for featured images. You shouldn’t need to manually set the featured images again; they should be automatically updated.
Keep in mind that the success of this process depends on your theme’s image size settings and the compatibility of the images in the imported content with these settings. If your theme requires specific custom image sizes for featured images, you may need to configure those settings in your WordPress theme or use a plugin to ensure the regeneration process aligns with your theme’s requirements.