Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upConfigure content in description field for each post #85
Comments
This comment has been minimized.
This comment has been minimized.
Hi @jserrao, TSF gets the fallback description data for singulars and terms from method I'm not sure why it always says bad, but I guess you're using a page builder? Page Builders internally prevent the Either way, there currently is no overwrite filter for descriptions or its extraction; I never thought one needed to generate their own descriptions. If you require a filter, please inform me on when and where :) I'd be more than happy to expand the API. Cheers! |
This comment has been minimized.
This comment has been minimized.
Ah, makes sense why this is pulling 'bad' descriptions on my site. I'm extensively using Advanced Custom Fields (ACF) and don't have a typical excerpt to pull, it's just getting a title and putting it into the description field now. What I've done to fix this is kinda hacky - basically, I just generate my own description field in a WP template partial for the head, injecting after TSF to fix the problem:
Ideally, I'd like to be able to redirect the default description field in TSF to a custom ACF field I've made ( |
This comment has been minimized.
This comment has been minimized.
Hi @jserrao, Just be careful it doesn't output duplicated tags, as Search Engines and Social Sites alike tend to take the first entry and might see this as an erroneous output. I'll see what I can do with a filter in order to short-circuit the output. That would be in 2.9.0-dev1. |
This comment has been minimized.
This comment has been minimized.
Hi @jserrao, I forgot there already was a short-circuit filter, but that will only adjust the actual output of the page, not all things that relate to it. For this, the following filter should be used:
The short-circuit filters that affects all (SEO Bar, placeholder fields, counters, etc.) are still on their way. Cheers! |
This comment has been minimized.
This comment has been minimized.
Thanks, great plugin btw. |
This comment has been minimized.
This comment has been minimized.
Thanks! Also, my excuses for not implementing the new filter already — I've been feeling under the weather as of last week. Nevertheless, I'll ping this issue when it's implemented. |
This comment has been minimized.
This comment has been minimized.
The filters:
Commit: 593bb9c Enjoy! |
This comment has been minimized.
This comment has been minimized.
When this is released, we'll be able to use one of these filters to set a default og:description that will be used when no other description exists? |
This comment has been minimized.
This comment has been minimized.
Hi @dvrcthewrld, Yes, that's possible. Be aware that you should never use duplicated descriptions.
|
This comment has been minimized.
This comment has been minimized.
@sybrew - just wanted to add that these filters work very well. I've been able to customize descriptions on a couple of sites now with durable results. Thanks so much for this addition. |
This comment has been minimized.
This comment has been minimized.
Hi, I have a similar problem, as I extensively use ACF and don't use How would I go about using the above filters to replace my descriptions? I also thought about using an ACF save hook to duplicate content into the main content area, but would prefer not to keep 2x the description field in the database if i can avoid it. Many thanks! |
This comment has been minimized.
This comment has been minimized.
Hi @PUncle The new filters were described earlier in this issue, and you should use: e.g.: add_filter( 'the_seo_framework_fetched_description_excerpt', function( $excerpt, $page_id ) {
$field = function_exists( 'get_field' ) ? get_field( 'my-field', $page_id ) : '';
return $field ?: $excerpt;
}, 10, 2 ); Regardless, I recommend using custom descriptions that fit Google's guidelines. As the enhancement has been made a year ago--I'm locking this issue. P.S. it looks like you're using Internet Explorer. I'm dropping support for that in the next major release. I urge moving to Edge or a Blink-based browser. |
I'm wondering how SEO Framework gets this data and is there a way to change it? It always says the descriptions are bad but wondering if there is a way to change the defaults without forking the project.