If you have a WordPress website or blog, I think you noticed that a paragraph tag is automatically added around images in WordPress post. This is default WordPress’ automatic post formatting system.
By default WordPress wraps images in a paragraph tag when you insert any images into a post. This is sometimes ridiculous. So, today we will remove auto formatting paragraph tags around images in WordPress post only. It can be done by adding a simple code snippet into functions.php file. So, lets get rid of p tags around images in WordPress post.
Go to theme editor and open functions.php file. Scroll down and paste following code at the bottom. This code work against the_content filter and get rid of p tags around images in WordPress content.
If the code works please press the share button and share with your friends. And if you find any error, go to cpanel and remove the code from functions.php file.