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?
- How to end the excerpt with a sentence rather than a word?
- Changing WooCommerce Display Price Based on User Role & Category [closed]
- What do add_filters() and apply_filter() do?
- What to use instead of the content_save_pre filter?
- How can I customize the wp_list_categories
- How can I reliably and globally disable wptexturize?
- Customise Jetpack Publicize text
- Add classname to the_category() function?
- Filter the URL of next_posts_link & previous_posts_link
- Exclude One Category and its Subcategories using WP_LIST_FILTER
- Explanation for remove_filter used in the below code [closed]
- Gutenberg disable the “block” tab in right sidebar
- add_filter to ‘woocommerce_before_main_content’ [closed]
- Editing
- add_filter to apply_filters that exists within class
- Echoing Categories only if they’re a child of a given category
- Adding a title prefix with the the_title filter
- Display Externally Retrieved Data within a Custom Template
- Can the wordpress color palettes by changed through Javascript?
- Filter on the_content doesn’t update the content being searched via register_rest_route
- Excerpt using Read More Tag
- Where to add_filter in theme functions.php?
- Any Ideas for Including “More Tag” with get_pages($args)?
- tag removed not using a filter
- WordPress Image update filter
- Why does WordPress strip custom HTML that are form elements and theme SVG icons?
- How to combine multiple body classes
- How to replace username with email address in users table
- why require – does not load filter
- term_link filter rewrite link only applying half of condition?
- What is the action hook to use if you want to capture the new password during password change?
- Need to return shortcode text instead of the output
- How do I check if I can use the allowed_block_types filter?
- Setting the page title in a plugin, but not outside my plugin
- Security question – Display a General Custom Login Error Message
- How to apply a filter to everything?
- WP Job Manager – display search results from custom search form in taxonomy-job_listing_category page
- Conditionally (cpt) filter previous and next_post_link
- changing size image within the content
- How can I display wp_link_pages before a shortcode, if it is used, or display after content?
- Limit total tags in the_content