Hi there!
Unfortunately, there’s no easy way to disable the functionality. This feature helps almost all users making use of that field, and serving for corner cases shouldn’t be dealt with because the inner workings are too complicated. Such changes result in bugs.
So, I recommend filling in a custom meta description. The plugin will then use this custom meta description.
Ah ok,
Guess I’ll park that idea then. I have nearly 5000 products so manually adding to the meta description will take far too long.
Hi again 🙂
This might help. It basically does the same as the plugin do internally, but then overwrites the “post_excerpt” when it’s found to be used.
add_filter( 'the_seo_framework_fetched_description_excerpt', function( $excerpt, $post_id ) {
$post = get_post( $post_id );
if ( ! empty( $post->post_excerpt ) ) {
$excerpt = $post->post_content;
if ( $excerpt ) {
$tsf = the_seo_framework();
$excerpt = $tsf->strip_newline_urls( $excerpt );
$excerpt = $tsf->strip_paragraph_urls( $excerpt );
$excerpt = $tsf->s_excerpt_raw( $excerpt );
}
}
return $excerpt;
}, 10, 2 );
The big problem with introducing this snippet is that you’ll have to maintain it. So, using it is entirely up to you.
Another issue is that it doesn’t know whether it’s overwriting a post or archive excerpt unless you introduce some heavy processing. So, some categories may use content from products as a description; this is rare, however.
-
This reply was modified 7 years, 3 months ago by
Sybre Waaijer. Reason: Removing failing check in snippet