try this
add_filter( 'get_the_excerpt', 'strip_shortcodes', 20 );
or try this edit
echo strip_shortcodes( get_the_excerpt() );
if shortcode is not register with wordpress function add_shortcode
add_filter( 'the_excerpt', 'remove_shortcodes_in_excerpt', 20 );
function remove_shortcodes_in_excerpt( $content){
$content = strip_shortcodes($content);
$tagnames = array('box', 'alert'); // add shortcode tag name [box]content[/box] tagname = box
$content = do_shortcodes_in_html_tags( $content, true, $tagnames );
$pattern = get_shortcode_regex( $tagnames );
$content = preg_replace_callback( "/$pattern/", 'strip_shortcode_tag', $content );
return $content;
}
Related Posts:
- Setting a default text for excerpts of a particular category
- Appending „read more” to the excerpt conditionally
- Remove External Links from WordPress posts Using add_filter() in Theme functions.php
- Hide disclaimer from summary excerpts
- How to make an If Else on Excerpt Filter
- Regex works in regexr, but not if I filter content [closed]
- Can’t change excerpt length and more tag
- function to show youtube videos within excerpt – if condition and apply_filters
- remove empty paragraphs from the_content?
- Issues with title-tag and document_title_parts
- Remove Actions/Filters added via Anonymous Functions
- Set JPEG compression for specific custom image sizes
- Define custom Page Template without its own .php file
- Add class to menu items of one specific menu (nav_menu_css_class)
- How to influence the information displayed on widget inside wp-admin
- Removing default image size list in Media Box
- How to restrict actions and filters “properly” by conditions
- Filter the query ONLY for the search results page
- Check if the user has explicitly set an excerpt
- opening links in new tab using – add_filter( ‘the_content’, ‘make_clickable’);
- Using add_filter() in Widgets
- How to override function in functions.php of parent theme?
- Customize WordPress Media Manager – Media Window
- How to reduce original image quality on upload?
- Is it possible to use a forgot password url filter?
- syntax for remove_filter in parent theme with class
- Add body class of category parent
- Show Video in Excerpt
- When is wp_trim_excerpt() called?
- Wrap gutenberg block ‘div’ in other elements/extra HTML
- Convert hyphen to underscore in permalinks
- Override parent theme function that is not hooked or in the functions.php file
- Remove Page Title from Static Frontpage
- Stripping shortcode from custom excerpt function
- Programmatically Add Font-Awesome Icons to Category Widget
- Remove bulk actions based on user role or capabilities
- Default or Preset Content for Custom Post Types
- Remove images from get_the_excerpt
- Custom page template how to check is_page from functions.php?
- display public excerpt for private post
- Override a class function to include a custom template
- How to override filter in child theme?
- Removing title from page
- Hide some items from Screen options in dashboard for products
- get_the_excerpt() not returning anything when post has no excerpt
- get excerpt without images
- How to change a certain text or term of WordPress into a custom into the whole site?
- Adding body class when post contains a specific shortcode
- Allow latex in wordpress excerpt
- Replace Archive Widget Link Text
- Exclude Empty Child Categories in Menu
- How to make unique add_filter to the_content of specific page template files – so each template gets its own addition
- Custom excerpt legnths for specific pages
- Best way to programatically add “rel” attributes to page and post images
- add_filter priority problem
- Limit filter upgrader_post_install to a single plugin
- How to update feed only 2-3 times a week (for Feedburner email)?
- Manipulate Output of wp_list_something: select menu instead of li’s
- Clean-up script tags
- How to use IF Statement in WordPress?
- Gravity Forms field entries into wp_query loop [closed]
- Post Pagination Showing Same Posts Every Page
- Show excerpt for only first post in query
- Remove function or filter
- modify a function filter
- Super simple shortcode not working
- How would go about if I just want a temporary function?
- Generating rel=prev and rel=next only on wordpress categories
- How to make applyFilters function return false via functions.php
- Accepted arguments value in hook functions
- Get current page_id before loop, in functions.php
- Using “Read More” link with custom excerpt
- Which action hook to use for function?
- Adding multiple taxonomy filters to functions.php
- str_replace function in theme
- Can’t check if a post has thumbnail adding filter to get_post_metadata()
- Adding HTML to the end of every post with the Block Editor
- Last updated date function
- How to display post content instead of excerpt
- Modify a function without editing template
- How to set default archive image without overriding first attached image? [closed]
- How do I add Bootstrap and LESS to my migrated WordPress site?
- How to add nav menu items to a specific position within a menu
- Passing values from a widget to a function within a plugin
- Only let plugin add actions to wp_head & wp_footer on single posts
- Using Schema with `the_excerpt`
- Publish/Update post is changing image links from file url to post url
- Disable auto-resizing of uploaded images, but only for certain filename
- How to make custom column Admin>Users sortable?
- Filter out other users comments. Visualize only own comments and editor role users’ comments
- Get Current Post ID in functions php, meta query filter
- Output and filter data from a XML url
- Add to cart php not working [closed]
- Is possible add icon in title posts only in specific tag?
- What did I do wrong in my functions code, that will not change the “Get New Password” text to “Send It”?
- Custom Post excerpt not working correctly
- create filter in functions.php
- Limit length of first excerpt in the loop
- How to filter $content in shortcode function
- Insert image in WordPress with HTML5 tag and caption function