You can try this one:
$string ='<p>LOREM IPSUM!… <a href="http://localhost/post/3" class="read-more">Read More</a></p>';
$string = preg_replace('/<a[^>]*(.*?)<\/a>/s', '', $string);
echo wp_strip_all_tags($string);
//return LOREM IPSUM!…
Related Posts:
- Theme Check gives: Required: This theme doesn’t seem to display tags?
- Twenty Eleven home page show only excerpt
- How to call the_excerpt() with tags or the_content() as an excerpt?
- How do I hide tags that have only been used once?
- How to check if post has any tag?
- Is there an error in get_the_tag_list()?
- How to programmatically bring back “excerpts” field in post editor in WP 3.1+
- How to hide and content from auto-generated excerpts?
- the_excerpt() not showing manual excerpt for Pages
- What are the Theme tags in style.css used for?
- Any tag pagination page (except the 1st page) loads index.php template instead of tag.php
- What tags should be used for themes to show the type of layout?
- Bold letters inside excerpt [closed]
- Using wp_tag_cloud(‘format=array’) to print tag names without links?
- How to move the the_excerpt’s read more link to another div
- buddypress: how do i make the group description excerpt shorter?
- the_excerpt(); tag not working
- How can I wrap html around the output of the_time function?
- Disabling automatic teasers
- How to make the excerpt_more filter apply to the actual post excerpt?
- How to obtain a reference to the_excerpt() from custom loop
- Force Balance Tags not working
- Exclude read more in the_excerpt [closed]
- Custom get_the_excerpt() only works on first post
- excerpt() shows different result between remote and localhost(development environment)
- Tag Page Not Listing All Posts With Tag
- Add tags to pages
- Why tags are displayed bellow the content and not inside
- adding class to excerpt
- Why Tags don’t appear in my page?
- Single.php the_excerpt loads same as the_content not loading read more line
- first excerpt fine, subsequent post excerpts shift to the right instead of displaying vertically [closed]
- matisse theme show excerpts not whole content
- restrain filter on get_the_excerpt to queried item in stead of current post
- How to make force_balance_tags balance comment tag
- Twentytwenty theme p-tags break em- and strong-tags that span several paragraphs
- Filter URL and shortcodes from the_excerpt
- Displaying Tags for the Page I’m On?
- Only show read more text when when wp:post-excerpt meets excerptLength
- Menu items description? Custom Walker for wp_nav_menu()
- How to define and link full path to css located at a random folder on header.php
- Sizing screenshot.png without losing aspect ratio
- Software for WordPress Theme and Plugin Development? [closed]
- When to use is_home() vs is_front_page()?
- What is the preferred way to add custom javascript files to the site?
- Get the blog page URL set in Options
- How to create .pot files with POedit?
- How do I get the theme URL in PHP?
- Why when I submit a form in wordpress it loads a 404 page though URL is correct
- What is the constant WP_USE_THEMES for?
- Worthwhile to restrict direct access of theme files?
- How Do I Protect My Premium WordPress App Theme from Copying?
- How to detect mobile devices and present them a specific theme?
- Using wp_add_inline_style without a stylesheet
- How to add posts to custom menus?
- WordPress Theme Preview Image
- How To extend WP_Customize_Control
- What is the difference between front-page.php and home.php? [duplicate]
- How can I get page slug
- Does the functions.php file ever get called during an AJAX call? Debug AJAX
- When to use _e and __ for the translation?
- What is a Theme textdomain?
- How to show a custom meta box on the “Quick Edit” screen?
- How to add CSS class to custom logo?
- How to add custom css file in theme?
- How important is it to enqueue a theme’s stylesheet?
- CSS not updating in browser when I change it
- Display Search Result Count
- wp_nav_menu(), how to change class?
- theme path in javascript file
- Is wp_is_mobile() effective?
- Display Menu Name using wp_nav_menu
- Making update notification functionality for my themes
- What questions do you ask when asked to give an estimate on theme development?
- How to remove dashicons.min.css from frontend?
- How do I remove a pre-existing customizer setting?
- Minimum Template Files for Theme Development
- What’s the difference between home.php and index.php?
- pass object/JSON to wp_localize_script
- get_template_part vs action hooks in themes
- Theme Activate Hook
- Solutions for generating dynamic javascript / CSS
- wp_redirect() – headers already sent
- Can I create my own “Recent Posts” widget or customize the existing one?
- Custom single template for a specific category
- how can I add an icon/image for a child theme?
- How can I add a URL field to the attachments window?
- The the_post_thumbnail without srcset?
- The proper way to include/require PHP files in WordPress
- Get the first image from post content (eg.: hotlinked images)
- after_setup_theme always runs
- When to use add_action(‘init’) vs add_action(‘wp_enqueue_scripts’)
- Getting failure when using filemtime() with wp_enqueue_style
- Do I actually need to link my theme’s style.css in the theme files
- Why is wp_head() creating a top margin at the top of my theme header?
- How to store widget fields data as an array?
- How do I add version control to my workflow?
- Using classes instead of global functions in functions.php
- WordPress API Menu/Submenu Order
- How can I display a menu on certain pages only?