If it’s just needed in one place, you could use the following:
echo wp_strip_all_tags( get_the_excerpt() );
Keep in mind, using the custom excerpt field will automatically remove all tags. Creating an excerpt automatically from the post content will not.
If you want more control, you can use wp_trim_excerpt()
or wp_trim_words()
.
See: Using wp_trim_excerpt to get the_excerpt() outside the loop
In your case, it would look like this:
echo wp_strip_all_tags( wp_trim_words( get_the_excerpt(), 60, '[...]' ) );
wp_trim_words()
allows you to pass in the text source, number of words, and the more text. You can remove the more text by setting this to false
.
Related Posts:
- Check if the user has explicitly set an excerpt
- How to override function in functions.php of parent theme?
- Show Video in Excerpt
- When is wp_trim_excerpt() called?
- Stripping shortcode from custom excerpt function
- Remove images from get_the_excerpt
- Custom page template how to check is_page from functions.php?
- display public excerpt for private post
- get_the_excerpt() not returning anything when post has no excerpt
- get excerpt without images
- Allow latex in wordpress excerpt
- Custom excerpt legnths for specific pages
- How to filter out shortcode when displaying the_excerpt() in the loop?
- Using “Read More” link with custom excerpt
- How to display post content instead of excerpt
- Using Schema with `the_excerpt`
- Custom Post excerpt not working correctly
- Limit length of first excerpt in the loop
- new_excerpt_more link not working properly
- Excerpts are not displayed by a shortcode on category pages
- How to display retweet count and likes in the meta above the excerpt
- Setting a default text for excerpts of a particular category
- Remove links from the_content when using filters wp_trim_excerpt
- Excerpt for pages not showing
- How do I pull excerpts from pages?
- WordPress Excerpt – How to remove the first link using functions.php
- How to change value of variable in theme file with functions.php WordPress?
- first paragraph of the_content as meta description
- Adding Read More to Custom excerpts
- Limit number of characters in different excerpts
- the_excerpt function not showing image
- Appending „read more” to the excerpt conditionally
- Hide disclaimer from summary excerpts
- How to make an If Else on Excerpt Filter
- getExcerpt: Make ellipsis appear only if character limit is reached
- need help with ‘… read more’ excerpt in functions.php
- Excerpt length: get 2 paragraphs
- Check if excerpt is empty at loop-portfolio
- Can’t change excerpt length and more tag
- More link – not text
- How to add an excerpt and read more link to a page?
- Adding a filter to my posts
- Excerpt – First Sentence & Read More
- function to show youtube videos within excerpt – if condition and apply_filters
- How to add a data attribute to a WordPress menu item
- Functions.php code that only runs on localhost?
- hook a functions to change wp-config from functions.php
- Relative URLs and hide /wp-content/themes/
- Slugs as breadcrumbs for Pages
- Removing Unnecessary Text from Admin Menu without CSS
- Add a Post Thumbnail to an RSS Feed with custom size
- Remove_filter (‘the_content’, ‘wpautop’) is not working
- Ajaxing function in widget class
- Clean-up script tags
- WordPress function for 1 to for many
- How can you limit srcset on a single type of page?
- How to fix Warning: call_user_func_array()?
- wp_register_script(… $in_footer = true) not working
- I want to get product attirbute in the section below
- Restore Image Title Text
- Output and filter data from a XML url
- Full page template function
- Redirect from “private” page and functions.php which tag add to add_action()?
- Display gallery on bottom after content
- WordPress listen to $_POST in functions.php
- Add Element as a Filter to the_content
- Storing password (functions.php)
- WordPress function, Run using Crontab
- Check if the image size is available and if not use ‘full’ image size
- issue with if/elseif in_array inside foreach loop display only one post
- Add Link to Users List (Backend) to open each users front-end profile
- Editing the formatting.php file vs functions.php file?
- wp_usermeta – Read from database, but save function broken
- remove/hide wp-editor
- Function not saving unchecked checkbox
- Entirely Different Functions.php per Page?
- Output comment_author in array
- Problem with shortcode inside a shortcode
- Hide Author By-Line if After Certain Date
- wp_title() return random number
- How to add class dynamically from templates
- How to change form action of wp-login page with a function
- How to add link rel tags on paginated posts?
- How to pass data from a plugin to functions.php
- Function to disable “href” anchor tags that contain “a data-name” on mobile only
- Execute jQuery with custom event listener after successfully add an item to the cart
- WordPress hooks to call a function inside a construct
- Translation Function missing text-domain [closed]
- Custom taxonomy not refreshing page on add
- disable WP_error: authentication_failed
- Load a Child Theme’s style.css just before the closing tag
- Can’t wrap my head around this function – any help would be appreciated
- Figure inlined width trigger distorted layout
- Exclude javascript in certain page url and all following url’s after forward slash
- Changing functions.php and .htaccess files
- Shortcode Variations?
- How to test for a class (from a plugin) in functions.php
- Child Theme not working – CSS gone
- WordPress – Notice: Function wp_enqueue_script was called incorrectly
- post_row_actions filter from parent theme not executing in child theme