To me you code looks good, I would recommend adding priority as high as 9999
Heres how :
add_filter('the_content', 'filter_ptags_on_images', '9999');
Related Posts:
- Stop WordPress Wrapping Images In A “P” Tag
- Get content from one page and show it on another page
- Content editor creating blank paragraphs in spaces and creating   in the_excerpt
- Testing for post title in ‘if/else’ statement returns no content
- Why content_arr[‘extended’] removes paragraph tags?
- the_content() Not Grabbing All Content
- why my urdu text is not aligned properly when written in wordpress blog post?
- Stop WordPress automatically adding tags to post content
- How to get ‘post_content’ without stripping tags?
- Keyboard shortcut for updating a page or post?
- Customizing HTML Editor Quicktags button to open a dialog for choosing insert options
- Removing any and all inline styles from the_content()
- Allow user to “edit_others_posts” to save only, not publish
- Let private posts stay in status “private” after edit through “editors”
- How to disable content pagination?
- How to create WP Editor using javascript
- Modify ‘Read more’ link adding a new class
- How to remove Nextpage tag inside posts text depending of utm_campaign
- How to add editor’s name to entry meta byline?
- Adding a div class or id inside the_content()
- How can you make sure authors’ posts are longer than 250 words?
- What is the best / efficient way to get WordPress content by post id and why?
- Restrict access to post if it is currently being edited
- JSON not valid after json_encode posts
- How can I allow editors to leave comments on posts that have not yet been published?
- Add default content to post (for specific category)
- Hide parts of the post content on the home page
- Filter/Remove HTML Elements on all posts and pages
- Paragraphs removed when using get_post_custom()?
- Load post content into div with ajax
- Custom function for “Submit for Review” hook
- How to add custom content (text/image) at start of content (IN content ie the same line)
- Display the Content of a Post with qTip2
- How to show video from specific category on sidebar?
- how load content as pop-up using ajax
- How can I add a meta-box to the posts editor containing all items of a custom taxonomy as checkbox?
- Visual / HTML tabs vanished on editor
- Getting a 404 error when clicking edit page
- Batch process: remove first image from post content
- WordPress version 3.8 – Preview button not working for editor
- Uppercase first sentence in every post
- How to add pagination in between post and comments?
- Make Post Editor Select Number of Columns To 1 By Default
- Unautop / Sanitize content added to a post through a plugin
- is there a way to show the the post title after the image?
- How to get rid of shortcodes in post content once and for all
- Add Word Limit to Posts
- Adding the_date inside tags around the_content
- Show the content that is after the excerpt using child theme
- Lost draft under all posts and drafts
- Show only one page link in content pagination
- get query() without post content?
- Filter only the text in the_content
- How do I do a page break?
- How to check if single.php has already called the_post_thumbnail function
- How to disable the_excerpt from one post
- Page and post loop same template
- WordPress.com post editor replacement
- Benefits to using semantic HTML in post content? [closed]
- Hide parts of the post content after typing it’s name or searching it by category
- Preview page/post revisions without overwriting current content
- Posts and Pages w. private visibility don’t show up in existing content
- Adding if statement into the_content()
- Keyboard shortcut for headings on safari
- Plugin for visitors to edit content without logging in? [closed]
- any way to access variables from within post editor?
- definining own teaser text for post
- Add text and change style to post programmatically depending on category
- How do I display main query posts in random order using add_filter
- How to Remove HTML Elements from Post Excerpt?
- How to exclude native lazy loading from first image in post content?
- Embedding Post Editor Into External Site
- My website is showing today’s date instead of published date since db migration to a new wordpress
- Related post not showing table of content
- How to limit wordpress the_excerpt() dynamically
- How to get unmodified post content?
- I have inserted a post’s content in homepage.php by the post-id. The font isn’t matching with the theme. How do I change font of this content?
- Display simple html code in post
- if CPT content is empty then
- How do I set content in my pages so that it remains permanent while blog posts are added below?
- Find post tags words in post content and link them to tag URLs
- Nothing appears using get_the_excerpt() in category.php
- WordPress each user has each content for a page,how to do that?
- Add caption to thumbnails in content
- Adding div to WordPress page content
- Add review box by function at top or bottom of content
- Add Image Before Posts Entry Title
- Adding editable content above posts
- Showing content from WordPress ruins page CSS using WP_Query, without, content does not show
- Custom template for different post types
- Correcting the content width when sidebar is inactive?
- Multiple approval from editors before publishing?
- How to custom sort-out editing-panel fields?
- How can i show only 30% of the “the_content(“More…”)”?
- jquery: getting contents of #content field on post page
- the_content() not displaying the full post
- Post thumbnail is not shown in wp-admin
- What does WordPress mean by they have full rights to content [closed]
- wordpress pinboard theme [closed]
- Notify/check if the content of a custom gutenberg block has changed on save_post