You’d better never disable those actions (what you say). Instead, insert add_filter('the_content', 'MyFilter', 88 );
and create such function:
function MyFilter($content){
$tags = array( 'p', 'span');
///////////////////////////////////////////////////
///////// HERE INSERT ANY OF BELOW CODE //////////
///////////////////////////////////////////////////
return $content;
}
======== METHOD 1 =========
$content= preg_replace( '#<(' . implode( '|', $tags) . ')(.*|)?>#si', '', $content);
$content= preg_replace( '#<\/(' . implode( '|', $tags) . ')>#si', '', $content);
======== METHOD 2 ======
foreach ($tags as $tag) {
$content= preg_replace('#<\s*' . $tag . '[^>]*>.*?<\s*/\s*'. $tag . '>#msi', '', $content);
}
======== METHOD 3 =========
DOM object (preferred): https://stackoverflow.com/a/31380542/2377343
Related Posts:
- How to use “Add link” pop up for a WordPress widget
- Where can I find the code how wordpress parses a post?
- Removing the title attribute from links in the post content
- HTML code in Custom field
- How to wrap every image in a post with a div?
- Paragraphs removed when using get_post_custom()?
- get_post_custom stripping styling issue
- why does HTML Tag not working in Post and Page
- Content editor creating blank paragraphs in spaces and creating   in the_excerpt
- How can I control multiple editing of wordpress posts?
- Cannot Update A Post, 404 Error
- Strange problems when I try to insert HTML\XML code snippet in my posts
- Add scripts on custom post add/edit pages Not Working
- Add code just after Post content
- WordPress’ visual editor messing up my (nested) lists (and other things as well)
- Articles are text-only in any “Category” instead of HTML
- Ajax Dynamic Archives not showing correct results
- Ajaxify This Code
- Pausing and Resuming WP_Query results
- Is Hfeed class for all pages needed
- Adding an image to a non existing post
- Anyone know why wordpress converts some html entities to their numeric equivalents?
- Best Way to Add UnEditable HTML to Posts
- Divs appearing everywhere in post content
- Can’t give tags rels
- Benefits to using semantic HTML in post content? [closed]
- Creating a WordPress Post via REST API – HTML or Markdown?
- HTML Form Submit to table in same page
- How to determine if a post was last edited in the Visual Editor
- WordPress wp_editor to post and edit
- Locally change the font family [closed]
- Right align a youtube video
- WordPress 5: prevent link from displaying page title instead of URL
- Include Recent Post in Category
- WordPress Recent Post with the badge “New” on the side of the title post
- Remove HTML tags from all posts
- Checking if a post contains an html tag
- How to generate an HTML link automatically from URL in a users’ post
- Creating a frontend blog post form for logged in users only
- Show all posts from the tags without having to set all of them
- Adding div to WordPress page content
- Posts don’t appear on Template Page
- How to get all the terms of a post
- How to use wp_editor(); in functions.php then retrieve content in the template
- CSS – Change height of Storefront / WooCommerce product categories, but not products
- Wrap posts from a category in HTML
- How edit footer copyright info? [closed]
- How can I add a custom caclulation form in post?
- How to automatically convert a form with HTML link into post
- Posts Page in WordPress loading bare HTML of my homepage
- How to display by default only published posts/pages in the admin area?
- Is there an if statement that can determine if a post in the loop is the last post?
- Is there a way to disable the sticky posts feature?
- How to display comments and comment form on custom post type?
- How can I edit a post from the frontend?
- How to add an admin function only to posts, not pages?
- When paginating a Page with the tag, how can the 2nd and subsequent page styles be customised?
- get_post_field – Title without paragraph
- change default post archive page link
- Count search results in heading
- How to style the last post on the front page different than the others?
- Publish a Post on a Future Date Automtically
- Get mixed category random posts
- WordPress not opening posts with only numbers if permalink is post_name
- Decide user that can publish a post
- Increase 10 post limit per page
- Hooking into the post editing screen for an existing page only
- Shortcodes on my website stops working after theme update [closed]
- How do I retrieve a users’ last 5 posts?
- How can you display all sibling categories to a post?
- New Gmail email to a WordPress new post? [closed]
- How to show show the Second page title in the page
- How to calculate the average of a post meta value(Numeric) of a specific author
- retrieve the oldest post id
- How can I remove the first two words and shorten get_the_title()
- how to hide empty fields of post category description?
- how to add updated_by column to posts admin panel?
- If no posts exist for current day and month, show the next available day of posts
- How can I get rid of the automatically generating tags?
- Get latest post from categories
- Access last visit time to a post
- Loop not showing first post
- How to show a featured image inside a post in only 1 single category
- Custom Post Type Single Loop Outputting Wrong Post
- Geting error in post and category [closed]
- How to convert attachment pages to Posts?
- How to 301 redirect from url with post id to permalink with post name (slug)?
- Create/Set Category as Title of Post
- how can i fix my display post in my index.php
- List of authors posts minus very latest
- Add category attribute to custom recent post shortcode
- How Can I Limit Users to Post Creation For My Frontend Theme?
- how to create add-able metaboxes in wordpress post edit screen?
- Show Custom Post From Logged In Author
- How to display a paginated list of posts from one category on a page? [duplicate]
- Is there a way to separate wordpress titles from their posts?
- custom sort posts in archive/taxanomy page
- Show Title/Date/Excerpt of first post & only Title for rest in Query [duplicate]
- Show some texts in posts belonging to Specific category
- How to move all images in a post to a single gallery for a bunch of posts?