Ok, I found a solution.
I’ve found the filter excerpt_more
that is used to show the string shown within the more link (if theme use standard WP functions).
So, to achieve this, we need to hook the excerpt_more
and use a lower priority of the one used by the theme.
In my example, this
add_filter('the_title', static function ($title) {
return $title. '-boom';
});
adds -boom
string in both text and excpert, and this
add_filter('excerpt_more', function ($more_link_element) {
$more_link_element = str_replace('-boom', '', $more_link_element);
return $more_link_element;
},9999,1);
removes it from the excpert
Related Posts:
- Give “Read More” precedence over excerpt() word count
- Read More in the actual excerpt
- Remove description from on Home
- Get excerpt from $post->post_content
- Filter Widget Title Wrap
- Don’t replace “|” with Empty String (“”) when generating slugs from title
- How to use the_excerpt in a filter hook?
- Anyway to edit the titlebar of WordPress Widgets in the Admin area?
- add_filter on “the_excerpt” only works when post does not have excerpt
- Alter only the page title, not the post titles within
- Changing document title only on a custom page template
- Filtering ‘the_title’ with option to return subhead?
- wp_title() empty on a static front page
- End excerpt at the end of the sentence
- Can’t change the title tag with wp_title filter
- get_the_excerpt() with fallback like the_excerpt()
- Setting title using wp_title filter
- Add a Span Around a Product Title in WooCommerce [closed]
- Exclude filter on front page
- How do I filter get_the_excerpt() but keep all of its functionality intact?
- Buddypress: Edit activity when new blog post [closed]
- How to make a button?
- Wrap h1-h6 in a div
- Variables in post title
- Why in archive page doesn´t show read more button with excerpt?
- the_excerpt filter with an empty excerpt
- Is it possible to use multiple spaces in title?
- WP action/filter to modify title before header output and article output?
- Access get_the_title() from ‘excerpt_length’ filter
- How do I override the_excerpt so that it will display full content?
- the_excerpt filter doesn’t work as expected
- Excerpt is being added above the content, but it should be after it
- run shortcode in excerpt of single custom post type
- apply_filters(‘get_the_content’, $content) + Except
- Trimming a custom field to a length
- Filter media upload attachment meta
- Prepending character(s) to a custom tag title?
- Use of comment_reply_link_args filter
- Filter page title (displayed in browser tab) of wp-login
- Adding html banner to posts
- Apply wordpress filter checking category
- Strip $before & $after strings from a page title
- Add Filter – Pass Variable (PHP < 5.3)
- add_filter( ‘the_title’ gets through this if statement twice
- Modify WordPress Page Title ()
- Create different flavours of excerpt
- How to filter page title for certain page?
- Cutting off excerpt with first sentence
- get_the_archive_title hook unwanted changes!
- Auto-generated excerpt with shortcode and read more button/text link
- is_page_template() doesn’t work with excerpt_length filter
- Hide H1 Title using the_title filter
- Admin filter/error if post title is too long
- the_excerpt() does not work with has_excerpt()?
- get_the_excerpt on mobile still displays continue reading
- Can’t change excerpt length and more tag
- Custom excerpt_more filter not working when tag is present
- Auto append text after the title?
- Why does using excerpt_more filter change link location?
- Only show read more text when when wp:post-excerpt meets excerptLength
- hook on the_excerpt
- Disable emojicons introduced with WP 4.2
- How to remove a filter that is an anonymous object?
- WordPress hooks/filters insert before content or after title
- How to add defer=”defer” tag in plugin javascripts?
- add_action(), add_filter() before or after function
- apply_filters(‘the_content’, $content) vs do_shortcode($content)
- How do filters and hooks really work in PHP
- Trouble understanding apply_filters()
- What is the very earliest action hook you can call?
- How would one modify the filtering Gutenberg applies to pasted content?
- How can I modify the WordPress default widget output?
- Add custom options to the wplink dialog
- Remove classes from body_class
- what is __return_false in filters
- Explanation for apply_filters function and its variables
- Gutenberg: Is there a way to know if current block is inside InnerBlocks?
- How to reorder billing fields in WooCommerce Checkout template? [closed]
- Insert HTML just after tag
- the_content and is_main_query
- How to end the excerpt with a sentence rather than a word?
- Issues with title-tag and document_title_parts
- Changing WooCommerce Display Price Based on User Role & Category [closed]
- How to add a custom CSS class to core blocks in Gutenberg editor?
- How to show page content in feed?
- wp_headers vs send_headers. When to use each?
- Filter any HTTP request URI?
- How to Pass External Variables to Filters/Actions
- How to filter users on admin users page by custom meta field?
- Filter by one custom field, order by another?
- Apply the_title() filter in post & page title, but not in menu title
- Not able to change wp_title using add_filter
- apply_filters() and the_excerpt are giving unexpected results
- How to appending to the_content using add_filter with custom post type?
- Query WP REST API v2 by multiple meta keys
- No filter of code on switch from html to visual editor, how?
- Sanitize and data validation with apply_filters() function
- How to modify posts_where filter only for the search query
- How to hook a filter to catch get_post_meta when alternate a custom field output?
- How to get shortcode’s input values inside a filter?