Mismatched image class in existing posts
-
Hi there,
After migrating from wp.com to wp.org, I found out that the image class of some of my images in the existing posts are mismatched. However, I am not able to figure out any automated method to fix the issue.
As we all know, when an image is inserted in a post, wordpress would assign an image class and generate some markups automatically like this:
<img class=" size-full wp-image-YYYYY aligncenter" src="https://......XXXXX.jpg"
which the YYYYY in the “wp-image-” code is exactly the ID of the image.However, in my site, probably due to some errors occurred during migration, the image ID of some of my images are off by a bit. For example, the original image ID 10000 is now 10002 in my new site. However, in the post content, the markup of the image is still “wp-image-10000”. This creates a problem that the image class associated is mismatched from the correct image id, and the images are such not responsive.
The obvious fix of this problem is to update the “wp-image-YYYYY” code to the correct image ID (i.e. changing “wp-image-10000” to “wp-image-10002”). Or else, I could just reinsert the image into the post and wordpress would assign a correct image class accordingly. However, given that I have hundreds of existing posts and thousands of existing images, it is not possible for me to check if the image class of each image is correct manually.
I would like to know if there is any quick / automated way for me to fix the problem. Thank you in advance.
- The topic ‘Mismatched image class in existing posts’ is closed to new replies.