Skip to content

Bright Start – Delete an Image from a Post/Page

Believe it or not deleting an image from a WordPress post/page is harder than adding an image. It is important to only delete the code that you want to delete. There are three or four different styles of image code that you should look out for when deleting. Most important thing is the start and end of the image code just highlight from start to end and delete. Use the cases below as reference.

Case 1: Plain Image

This one is pretty east starts with <img and then ends with />.


Case 2: Image with a Caption

This code set will be a little bit longer, but the same rules apply. Starts with [caption and then ends with [/caption]

[caption id="attachment_219" align="aligncenter" width="500" 
caption="This is a Caption!"]<img src="https://www.groverweb.com
/wp-content/uploads/2011/11/wordpress-add-images-1.png" alt="Word
Tutorials for Bright Start" title="Grover Web Design Add Images to 
WordPress" width="500" height="500" class="size-medium wp-image-
219" />[/caption]

Case 3: Image Wrapped in a Link (a tag)

This case is when your image is clickable into a larger image, there will be an "a" tag wrapping the image code. This one will start with <a and then end with </a>.

<a href="https://www.groverwebdesign.com/wp-content/uploads/2011/11/
wordpress-add-images-1.png?x16219"><img src="https://www.groverweb
.com/wp-content/uploads/2011/11/wordpress-add-images-1.png" alt="
Tutorials for Bright Start" title="Grover Web Design Add Images to 
WordPress" width="500" height="500" class="size-medium wp-image-219" 
/></a>

Case 4: Image Wrapped in Center Tag

Occasionally, you will see images wrapped in centered tags. These will start with <center> and end with </center>

<center>any type of image from above</center>
downfinger
Free Consultation