Here is a safe and Yoast preferred method
add_action('wp_head','add_custom_meta_description_box');
function retrieve_var1_replacement( $var1 ) {
global $post;
return strip_tags($post->post_content);
}
function register_my_plugin_extra_replacements() {
wpseo_register_var_replacement( '%%mycustomdesc%%', 'retrieve_var1_replacement', 'advanced', 'this is a help text for myvar1' );
}
add_action( 'wpseo_register_extra_replacements', 'register_my_plugin_extra_replacements' );
You can now replace your %%excerpt%% with %%mycustomdesc%%
Related Posts:
- Set different Canonical url programmatically for every post
- robots.txt Not Updating
- How to solve Robots.txt problem with WordPress fresh install?
- Yoast SEO: title tags are repeating my website name and slogan [closed]
- How to ensure that a landing page created with WordPress does not enter the sitemap?
- SEO optimization gone not so well
- ASCII titles with Yoast SEO plugin
- Embed sitemap in a page
- charset problem in wordpress because of nginx config
- How to remove WordPress Virtual Robots.txt that keeps overriding my root robots.txt? [closed]
- How do I create custom tags for WordPress SEO? [closed]
- Yoast SEO plugin – Sitemap links greyed out & page priority
- Setting up robots.txt with Yoast’s Seo plugin
- Facing Problem with Description in Post and Home Page in WordPress
- Tagline showing instead of meta description!
- Yoasts plugin sitemap not detecting correct category URL format
- Robots.txt not updating
- Adding rel=”next” & rel=”prev” for paginated archives
- NoFollow Entire Website
- Does the ‘WordPress Order’ feature, within the WordPress Dashboard, have any impact on site architecture?
- SEO – Two WordPress websites on same domain name
- SEO meta description and title tag Yoast SEO
- What does short_ping do?
- Disallow author with robots.txt
- Can I change the contents of a description meta tag generated by Yoast?
- Seo WordPress Pages on google [closed]
- What does it mean by “Home page / Archives” in JetPack Site Stats? [closed]
- alt tags of the images are not saving/emtpy
- is it good to use WordPress in the same url extension in terms of seo?
- Getting error when trying to implement site-wide breadcrumbs in Twentytwentyone Theme [closed]
- How may I see all the pages on my wordpress website and see when they were created?
- Yoast SEO plugin “could detect no serious SEO problems” on dashboard
- Reactjs headless WordPress theme configure SEO
- WordPress Sitemap including pages that aren’t there
- How to Change The Title in WordPress For SEO
- WordPress thinks my custom taxonomy pages are search pages #seo
- Automatic SEO for wordpress [closed]
- How to hide sensitve page from google spiders and non-membres in wordpress!
- How to rewrite title- and meta-description templates for page templates in Yoast Plugin [closed]
- Facebook og:image issues after https change [closed]
- Custom Canonical URLs
- how to set title of each page or post for SEO
- Help in using SEO Plugins: SEO Ultimate And Yoast SEO Plugin
- How to remove Date from Meta Description on SERP?
- Search Engine Visibility checkbox after indexed
- Yoast Force Rewrite Crashed Site [closed]
- best way to stop this wordpress duplicate content
- wp_strip_all_tags [closed]
- Yoast primary category query modification
- WordPress yoast seo plugin – parse snippet var in meta description
- Adding a H1 Tag to Post Tags automatically, but hide the tag? (Same for Category)
- How to stop showing my under development site on Google Search [closed]
- Updating old website links to new website links [closed]
- Search results show a different site [closed]
- Fix description of website on Google Search result
- Genesis / custom template page / setting the page title and meta desc
- Pinging or sitemap plugin: which practice is better
- The inner mechanism of WP SEO plugins
- Does having two installations of WordPress negatively affect SEO? [closed]
- Maintain SEO of a website while migrating it to WordPress?
- WordPress Meta Title Separator
- Customizing SERP content for WordPress Blog
- Pages and posts with Rel Canonical issues across entire site
- Add parameters to Yoast SEO plugin schema in functions.php [closed]
- How to dissallow all wordpress posts in robots.txt?
- Workaround for og:image unsupported webp image type, Yoast SEO?
- I have redesigned a website and my blog page has different permalinks
- custom wordpress theme and yoast seo injecting text in body
- WordPress site for increase SEO ranking in other e-commerce store
- Remove Noindex?
- WordPress Embed Page no-index meta data missing
- Unlimited false pages showing in Sitemap?
- Does anyone know why my SEO and title become one?
- My wordpress local urls is still displayed even moved to live
- Permalink not changing according to post type
- SEO Site Title appearing in google search despite not being added
- 301 redirects after changing permalinks
- How to add blog in default WordPress post type for SEO standard rule?
- Not sure if to keep this or not (noindex question)
- Category Name and Slug field need to be the same otherwise it breaks category pages
- mobile usability issues with /wp-content/uploads/ folders
- Change WordPress url for newly formed posts or pages
- OpenGraph descriptions not showing when using WordPress SEO (Yoast)
- Best Way To Structure 3 Tiered Site
- deeplink juggernaut – remove settings
- special XML to wordpress posts
- wordpress theme: on site seo [closed]
- Anchors in WordPress not followed/ indexed in sitemap.xml
- Not Being Indexed by Search Engines [closed]
- Enabling canonical links to force search engines to go to site.com rather than site.net [closed]
- Disallow /cgi-bin or not? [closed]
- Google Tag Manage – to use or not to use
- Multiple Domains Same Install Different Static Pages
- Possible to change meta data single quotes to dobule quotes in yoast wordpress seo? [closed]
- Can I delete the redirection in WordPress after switching URLs manually?
- Hide my staging subdomains from search results without impacting the visibility of the root domain
- how to make yoast seo read text from custom fields in custom post type
- If a landing page is my home page, and it shouldn’t contain navigation links, then how should it lead to other pages? [closed]
- How to improve WordPress website SEO and traffic, and or fix SEO issues
- How to fix Links do not have descriptive text PageSpeed Insights