Way overthinking it:
<?php
add_filter('wpseo_opengraph_desc', function () use (&$data) {
$seo_intro = trim($data->seo_intro);
if ($seo_intro === '') {
$seo_intro = "{$data->name} - {$data->title}";
}
return esc_attr(wp_strip_all_tags(stripslashes(do_shortcode($seo_intro))));
}, PHP_INT_MAX);
?>
Essentially, hijack the content with a filter (since that’s what Yoast is using to derive the description) and make sure it’s the last filter to be ran to return back my predetermined content.
EDIT
Instead of adding a filter on the_content
, use Yoast’s custom filter wpseo_opengraph_desc
.
Related Posts:
- How do I change the element using a custom function?
- Setting Custom WordPress “Posts page” AS “Front page”
- Multiple Inputs in a Customizer Control
- Embedding a SOAP Client into a WordPress Plugin?
- Remove WordPress theme from a specific page
- How to keep a WordPress site synchronized between two servers?
- difference between esc_attr(), strip_slashes(), strip_tags()?
- Rearrange elements outputted by comment_form()
- How to build custom WP admin with custom URLs
- Custom editor field displaying HTML in Visual editor
- generate unique number when registering a user
- Looking to display non-image files in Gallery with logo specific to file type
- How to set default values for options page
- Is it ok to not a have child theme and just create a theme from scratch?
- How do I deque the default stylesheet?
- How to Remove Subscribers from the Post Author Drop Down
- How to import custom data via XML, CSV, etc
- Widget Javascript code (ajax)
- Why would switch_to_blog stop working?
- $wp_customize->remove_section for customizer setting?
- How to remove query string from static resource in WordPress?
- Modify a theme to insert custom widgets?
- Fatal error: Call to a member function add_rewrite_tag() on a non-object in /wp-includes/taxonomy.php on line 333
- Search a post using the date it was posted
- How can I defer these JS files?
- Change login error messages? Cookie error message
- Allow non-admins to access the Customize theme page
- Query post for ‘selected category’ in archive.php
- Multiple Images/ Slider with custom post [single.php] [closed]
- How do I change the markup only of a built-in widget?
- Is it possible to make widget return only data (eg, array)?
- Add Custom API Call to WP-Login.php
- How to structure model showcase
- Admin search post meta
- How to recover permanently deleted blog posts?
- Create “alternative/zebra” boxes in the content area?
- Multi-site User Sessions
- Add Field to WordPress Register Form
- website with pretty permalinks except pagination
- How to create a control for css opacity in the Customizer
- How to do big modifications to live site?
- How to change the “All Categories” label within the panel of my custom post type?
- inserting uploads into subdomain
- Target pages using a specific page template
- Show title bar only on archives / hide it on all posts and pages
- Rename WooCommerce sorting dropdown options [closed]
- How to start editing my site with WordPress?
- Add or Create Custom Structure Tags to Permalink
- Setup database structure with books, authors, languages etc. for publishing house [closed]
- Dynamically Filtering Posts by Data Points – Any Pointers?
- Woocommerce custom checkout form
- Remove welcome panel from contact form 7 page [closed]
- How to remove admin menu pages inserted by plugins and themes in the top admin bar?
- WordPress custom dropdown listings
- Custom Tags Archive – permalinks not working
- Help customising admin bar, removing buddypress links from dropdown
- Do I need to instantiate the XMLRPC class or any class in another class to access its methods?
- WordPress in a Subdirectory
- Get custom field value from not-current page
- RSS feed showing deleted post
- Custom page template, not acting as page
- how or where wordress collect unlogged user session
- Customizing woocommerce product page
- javascript file not working in a plugin template file
- If Term Name Exists, Append a Unique ID to Slug
- Customizer options limited to specific user roles?
- Woocommerce custom “My Account” Tab – Add Save button
- WordPress Using Zip code customer shop find without woocommerce plugin
- How can I display both LTR and RTL language texts on the same page?
- New Page/Post Screen Opens an Existing Post
- how can custom permalink structure use for specify custom post type
- Add button to My Sites dashboard page (multisite)?
- Cannot go to next page on phone but can on computer
- Embedded Options in a Custom Metabox
- A specific menu inside a page, load different contents without reloading it, under the same link
- How to hide or remove a custom widget area when empty
- Dockerized WordPress is having Nginx Proxy Issues
- Create single{custom}.php with data in table out of wp_posts
- Highlight specific user with custom field value
- How do I display entries in the top menu based on conditions selected in the sidebar menu?
- custom loop issue
- How to define a static Home page
- let users add multiple divs in static page
- Bulk product editing in wordpress
- Best way to replace image url with source
- Multiple Taxonomies Using Custom SQL Query
- Logged in only custom page
- Make Terms Under Custom Taxonomy Use Specific Single.php Template
- Search results load individual post in slide out div
- Problem Locating and Changing Alt Attribute Of Link
- Pull certain WordPress posts on custom CMS instead and 301 wordpress to it?
- Show Site Name on WP login screen
- Adding css and js to a blank page created with custom template
- Create users via PHP
- Applying my own css classes in wp_menus 3?
- Conditional tag
- Set custom banner image size with wp_customize
- User Query Multiple Orderby Clause
- How to display product variations on same row
- Create a page for each database table entries