How To Remove Paragraph Tags From Around Images In WordPress

In January, I posted how much I really hate WordPress’ automatic post formatting, and we will continue it today on this post. That tutorial removes automatic paragraph tags in WordPress, but what if we just want to remove them from images?

Here’s how you can remove paragraph tags from around images in WordPress to make them look exactly what you want. We can fix it with this snippet. Just drop the following snippet to your current theme’s functions.php file:

Thanks to CSS Tricks for the snippet!