I use this on my instals to get rid of p tags around images:
/*
*
* Remove annoying <p> tags on images, messes with my shizzle
*
*/
function my_filter_ptags_on_images($content)
{
return preg_replace('/<p>(\s*)(<img .* \/>)(\s*)<\/p>/iU', '\2', $content);
}
add_filter('the_content', 'my_filter_ptags_on_images');
Related Posts:
- Stop wordpress from removing HTML attributes
- Stop WordPress removing tags when switching from HTML to Visual (TinyMCE)
- TinyMCE – how to select tags node from the place where the caret is?
- Strip and tags from a specific div
- how to see P and BR tags in tinymce?
- Why is wp_kses not keeping style attributes as expected?
- Add button to TinyMCE bar without creating a plugin
- How to include own css on wordpress tinymce editor?
- Order tags, but not alphabetically
- WordPress: Can I add categories/tags to all sites in my network at once?
- How to Get Next or Previous Post in a Specific Tag?
- How do I display a tag cloud under my post that only shows tags from that post?
- Display list of most used tags in the last 30 days
- Add a class to links in the visual editor (how to get old dialog back)
- Check if current page has given tag ID
- how do I get the tag name from tag id?
- Do tags have dates?
- What is the difference between terms and tags?
- Stop WordPress From Removing HTML Comments In Content
- How to edit the actual paragraph dropdown in TinyMCE with custom text styles
- How can I let my audience tag my posts?
- Display tags in list without link
- how can I use WP_Query to exclude a specific tag.?
- How can you tie into the tag metabox?
- not functioning
- How to use the Tag description as the title attribute?
- Best way to show map of tagged posts?
- How to display the_tags() as plain text
- Remove a particular tag name from the tagcloud
- How do I change the output of get_the_tag_list()?
- Query all posts with specific tag
- How to query with get_posts() for posts with any tag
- How to remove Tags: text from the_tags?
- Change tooltip in tag cloud
- Getting an ordered list of tags – via wp_tag_cloud or not?
- Is it possible to filter get_adjacent_post() with tags?
- Apply class to the a tag link generated in post tag links
- What are allowedposttags and allowedtags?
- Display tags for current post in sidebar
- How to allow user to perform search by more than one tag
- When switching from html to visual editor the tag gets erased
- How important are WordPress tags for SEO purposes?
- get_post_ancestors returns empty
- TinyMCE default link target to “_blank”
- Combining tags from post types
- TinyMCE style_select – Append Classes
- Display tags belonging to a specific post type only
- Allow visitors to search by multiple tags (specific IDs)
- List ‘n’ number of posts from a Tag, each with a different class or ID
- Showing all tags in admin -> edit post
- Redirect Tag to Post with the same name
- Add exception for specific tag
- Creating a Lightweight Media Tags Plugin with a Custom Taxonomy
- Link from tags to tag pages displaying all posts with that tag
- Displaying the most recently used tags
- Limit tag word count
- When are tags counted? Can it be trigered manually?
- How can I extend Quick Edit option with 2 more fields
- Remove tag on my RSS Feed
- Can’t Get ‘tag’ Page To Display only Tagged Posts
- How to separate the tags?
- alt attributes not showing on pages
- Creating a unique, linked list of tags from a specific category?
- Massive Tags Remove Using MySQL
- Add # before each tag
- Quicktags on all textarea.. Not working on plugin?
- term/tag not being saved for custom post type
- display tag slug as class per link in tag cloud
- how to change # of tag posts on /tag page?
- require one tag for each post
- How can I remove certain HTML tags from the RSS feed?
- WP API Get post with tag names instead of tag ID’s
- How to add class on term link?
- Link directly to the first post in an archive
- Set homepage to only display posts from one tag
- get_terms with more than x post count
- Tags as a dropdown with set tags
- Why ‘C++’ tag is converted to ‘C# ‘?
- Change the color of post title on specific tags
- How to show tags in posts, orderby count(most used) not alphabetically?
- Individual css class for each tag in wp_tag_cloud
- Strict tag list – user should choose only existing tags for posts
- Display tags with a twist
- How to use meta data for each tag cloud a
- Special characters in tag get removed for comparison on save
- Exclude a specific tag from the get_the_tags list
- Display all posts of current viewing tag
- Limit tag cloud terms by date
- Efficient Tag Management?
- Exclude specific tags (by id) from the_tags
- Listbox return wrong value in WordPress 3.9
- Display custom list of tags in post/page editor with hooks
- Is is possible to rebuild wp_term_relationships table?
- Get the latest tags in a cloud? [closed]
- Sort list of WordPress Page under tag when is_tag() called
- How to remove ‘noindex, follow, max-image-preview:large’ in search page WordPress 5.7 up
- Displaying Posts by tag dynamically in WordPress
- Order tags by the order they were typed
- URL scheme to retrieve tag archive by ID
- How To Add buttons to the toolbar which appears in TinyMce when you click over images