Closed reekes closed 4 years ago
%%excerpt%%
uses the excerpt field for the content. Is there anything filled out in the excerpt field?
There's nothing in the excerpt field.
Using the %%excerpt%% variable will auto-generate an except (used as the og description, copying the first characters of the content) when there is no excerpt filled in. That's what's documented, and that's how it's working in every other past or post. The problem I'm describing is specific to a custom post type, yet I have other custom post types that all work.
When there is no excerpt or snippet filled in, this is what's generated in the HTML page.
property="og:description" content="LinkedIn Facebook Twitter Google+"
You can see this in the failing example I provided
https://argonsys.com/blog/annoucing-argon-systems-product-family/
I've tried reproducing the problem with a custom post type, but when using %%excerpt%%
it relies on the content to fallback.
It seems something is setting "LinkedIn Facebook Twitter Google+" in the excerpt field. Is this being added somewhere on the page?
Is this being added somewhere on the page?
No. Again, everything about the problem post is being done exactly as I do with all other pages and posts. There's nothing different about the problem post and the working posts from my end. I rely on the auto-generated default excerpt, and will write a custom snippet when I feel necessary.
What I'm telling you is the Yoast SEO plugin is NOT auto-generating the excerpt for this one type of post, AND it's inserting...
property="og:description" content="LinkedIn Facebook Twitter Google+"
My question, again, is how to get the Yoast SEO plugin to do the documented behavior of auto-generating the excerpt?
As I said, again, I have a few custom post types. Yoast SEO plugin is working correctly in all those other posts types except for my blog posts. I described how to reproduce what I've got.
I used "WCK Post Type Creator" to quickly and easily create a custom post. All I really wanted was to change the slug for my blog posts. So I have a custom post type of "post" with rewrite slug (set to "blog").
The "it" in your question something is setting "LinkedIn Facebook Twitter Google+" in the excerpt field is the Yoast SEO plugin.
Also, there's a bug where it's inserting "LinkedIn Facebook Twitter Google+"
Two problems with the Yoast SEO plugin.
After a lot of trial and error, I found what's triggering the bug. I'm using the Divi theme.
Creating a post with the Divi visual builder Yoast SEO plugin not auto-generate an excerpt.
To prove this I took the failing post, went to the editor and removed the Divi visual builder. Then published the post using the standard WP editor. This the Yoast SEO plugin auto-generated an excerpt.
Going back to the editor, and switching to the Divi visual builder I published the post once again. This time Yoast SEO plugin did not auto-generate an excerpt.
Therefore the bug is when using the Divi visual builder with a post (at least this is true for a custom post but probably also for a standard post).
Our plugin doesn't generate an excerpt, it uses the excerpt field to generate the description. If the Divi theme is adding some text in an excerpt, we will pick that up. I would suggest checking the theme and how it handles the excerpt field. If it leaves the excerpt empty, YoastSEO will be able to fallback on generating a description from the content field.
Since this isn't a bug on our side, this issue can be closed.
Closed? Really? Blaming Divi? Really? Are you familiar with the product's advertised features?
YoastSEO is documented to use the %%excerpt%% variable as:
Replaced with the post/page excerpt (or auto-generated if it does not exist)
It is being auto-generated if one hasn't explicitly provided an except. Yet when I use the Divi theme's visual builder to create the post, you're saying this isn't supported. Really?
Divi isn't adding anything. It's not creating an excerpt. What's happening is YoastSEO is failing to do the documented behavior.
You are saying the documentation is wrong if one is using the Divi theme to create the post.
Really? If I paid for this plug in would my bug reports be dismissed?
Since this is working when you don't use the Divi visual builder it means generating the description works like expected.
Because this bug is not something that is in our code generating a description, it is not something we can fix out our end.
You should update the documentation then. Say it doesn't support the Divi theme.
BTW - did you even try this, or are you just closing the bug without investigating it? How do you know this isn't a bug in "our code"?
Guess I'm better off knowing I shouldn't pay for this plugin, since the support is ready to dismiss bugs and blame others.
@reekes I'm sorry to hear you feel mistreated. I'm reopening this issue as we've got more compatibility issues with Divi and we should dive into this.
Thank you Caroline. I also found related problems with my Divi usage, where the og:description wasn't being added on pages, even when I had added a explicit excerpt in the Yoast admin settings. My except was added to the HTML as a meta tag for the description, but then not added as the og:description. Odd since both should be exactly the same (simply duplicated).
I stopped looking into this related problem after seeing my bug report here being dismissed. So I don't have better details for you at this moment (and going on my memory of seeing the problem).
If you're interested, I'll look into that problem further.
Thanks for your reply, @reekes! We're always interested in more details that could help us solve the problem. If you've found anything relevant, you can always let us know.
1.Add %%excerpt%% in the SEO-Titles and Metas Section
2.See that %%excerpt%% appears in the preview
3.Add a Divi Text Module
4.Confirm text has been added
5.See no excerpt meta description appear
6.Switch to default editor on the backend and resave
7.See excerpt
NOTES: WordPress: 4.8 Yoast: 5.0.1 Divi: 3.0.29 ( I dont have access to the newest one but reviewing the comments/issues above it may also affect the newest version)
Please inform the customer of conversation # 206439 when this conversation has been closed.
This seems to be an issue with some pages I have that were built using Media Bakery's Visual Composer.
The issue is caused by Yoast SEO using strip_shortcodes() on the post content which removes everything within shortcodes. Why not use do_shortcode instead?
@cutterax is 100% correct. This is easily solved by running the the_content filter before generating the auto excerpt.
I am using a theme called Charity NGO, which uses Visual Content Composer, and am having the same problems. The %%excerpt%% is not replaced by text. Even if I switch to the default editor.
@asteriskmmt " This is easily solved by running the the_content filter before generating the auto excerpt." how / where would this be done - do you mean editing the Yoast plugin code?
We use the following code, which works with any content enclosed in shortcodes. You can put this code in your functions.php or a custom plugin:
// FIX SEO incompatibility with visual composer
add_filter( 'wpseo_replacements', function( $replacements ){
global $post;
if( ! sizeof($replacements) && ! empty($post->post_content) ){
$replacements['%%excerpt%%'] = wp_html_excerpt( do_shortcode( $post->post_content ), 155 );
}
return $replacements;
});
thanks! this helped!!
Casper Voogt
casper.voogt@plethoradesign.com Plethora Design Work: (877) 515-6682 ext.2 https://www.plethoradesign.com
On Thu, Jan 25, 2018 at 2:56 PM, cutterax notifications@github.com wrote:
We use the following code, which works with any content enclosed in shortcodes. You can put this code in your functions.php or a custom plugin:
// FIX SEO incompatibility with visual composeradd_filter( 'wpseo_replacements', function( $replacements ){ global $post; if( ! sizeof($replacements) && ! empty($post->post_content) ){ $replacements['%%excerpt%%'] = wp_html_excerpt( do_shortcode( $post->post_content ), 155 ); } return $replacements;});
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Yoast/wordpress-seo/issues/6288#issuecomment-360581842, or mute the thread https://github.com/notifications/unsubscribe-auth/AAsHWLY0dWraq7Pq3kwu_xFvmXnPpzYQks5tONxegaJpZM4LP_7z .
I'm guessing you could update the excerpt length to 320 -- per Yoast's article on longer meta descriptions.
I've got to work on a site that was built using the theme that runs with the CMSMasters Content Composer tool which is very similar.
The fix suggested by @cutterax works in the front-end of my site so thanks very much! However in the admin the preview of the descriptions in the Yoast metabox doesn't change and still appears with the "please provide" message. Is this going to be the same for sites with the Divi visual builder ?
User reports the same issue with %%excerpt%% affects RSS feeds.
Please inform the customer of conversation # 321441 when this conversation has been closed.
@cutterax Thank you very much.
I have the same problem. I remembered that It was working about 2 yrs ago, but now, it's not generating automatically. So here is what I've found so far:
It seems that there's sth wrong with newer version. some screenshots are representing the issue. NB: The only active plugin is Yoast with twenty Seventeen Theme.
Yoast is not skipping over the shortcodes when the excerpt variable is used. These shortcodes get outputted into the Snippet Preview section
Please inform the customer of conversation # 515449 when this conversation has been closed.
Watching...
I'm having the same problem with a custom post type I created programmatically. My CPTs individually do not have manually-created excerpts, but in Yoast settings for this specific CPT I've said to use the excerpt as the meta description.
According to the Yoast knowledgebase, using the %%excerpt%% variable uses the manual excerpt if one is present, or an auto-generated one if it doesn't exist. When I view the source of one of the pages, I see a notice:
<!-- Admin only notice: this page does not show a meta description because it does not have one, either write it for this page specifically or go into the [SEO - Search Appearance] menu and set up a template. -->
Hi,
I'm having the exact same issue as eshannon3, although my issue extends to regular pages and posts as well. Does using %%excerpt%% automatically generate an excerpt?
Issue happens with WPBakery
1. Add a text module with WPBakery, see Yoast webworker tool identify the text.
Excerpt Variable Added
Webworker Picks up text
2 No description tag outputted
Tested with WP: 5.3.2 Yoast: 12.7.1 WPBakery: 6.0.3 and 6.1
Possible workaround would be to add the code here https://github.com/Yoast/wordpress-seo/issues/6288#issuecomment-360581842 into your theme's function.php file
1. Add Code to file
2. See excerpt appear as meta description and og description in source code.
Please inform the customer of conversation # 572918 when this conversation has been closed.
I've discussed this issue with the product owners and we've decided to close it for now.
While we're aware of the way that 3rd party pagebuilders use shortcodes to build their pages, for the moment we're not going to parse shortcodes for the excerpt. We might revisit the idea of a wider integration with pagebuilders in the future, and the parsing of shortcodes might be included in that project. But due to the nature of shortcodes, they might bring more harm than good if we decide to parse them out of the box. So for now I'd advise anyone with this issue to give the filter of @cutterax a try (see this comment). Please do take care with this implementation and make sure you know what you're doing.
I've having a similar issue to that described by eshannon3. Our theme is not using page builders, however we have a CPT with a template that relies on custom fields (ACF) and doesn't make use of the_content() where Yoast might typically auto generate from.
In our theme, we use add_filter( 'get_the_excerpt', '....')
which does the work of returning a custom excerpt when otherwise empty.
Are you using this filter when auto generating an excerpt in the Yoast plugin? Why would my filter not be used successfully returning our custom excerpt?
This is true in the following conditions
We use the following code, which works with any content enclosed in shortcodes. You can put this code in your functions.php or a custom plugin:
// FIX SEO incompatibility with visual composer add_filter( 'wpseo_replacements', function( $replacements ){ global $post; if( ! sizeof($replacements) && ! empty($post->post_content) ){ $replacements['%%excerpt%%'] = wp_html_excerpt( do_shortcode( $post->post_content ), 155 ); } return $replacements; });
This solution works partially and "breaks" my site, since the excerpt happens to appear multiple times (description, open graph, ...) the Divi shortcodes get parsed multiple times, and the blocks counter gets incremented each time, so at the end my rendered page is wrong, instead of a class ".et_pb_column_1" I get ".et_pb_column_25" cause the shortcodes got "rendered" multiple times, there should be a way of caching it once...
EDIT: I found a solution, counters can be reset in Divi, here's the updated code
// FIX SEO incompatibility with visual composer
add_filter( 'wpseo_replacements', function( $replacements ){
global $post;
if( ! sizeof($replacements) && ! empty($post->post_content) ){
$replacements['%%excerpt%%'] = wp_html_excerpt( do_shortcode( $post->post_content ), 155 );
ET_Builder_Element::reset_element_indexes("", true);
ET_Builder_Element::reset_styles();
}
return $replacements;
});
What did you expect to happen?
Adding the %%excerpt%% variable to Titles & Meta settings should autogenerate a snippet from the content.
What happened instead?
No content in the snippet. When I go to a post to edit, in the Yoast meta box I shows %%excerpt%% in the snippet. But if I view the actual published page, there's no description for the page being added. If I manually add a snippet, that does get published.
It's the auto-generated snippet feature that's failing, and only for one specific custom post type. I have four different custom post types and it's working in all expect this one type.
How can we reproduce this behavior?
I used "WCK Post Type Creator" to quickly and easily create a custom post. All I really wanted was to change the slug for my blog posts. So I have a custom post type of "post" with rewrite slugs.
I also created three other custom posts types, but those are working.
Can you provide a link to a page which shows this issue?
Failing example: https://argonsys.com/blog/annoucing-argon-systems-product-family/
Working example: https://argonsys.com/learn-microsoft-cloud/articles/storage-spaces-direct-lab-setup/
I can code page templates, debug, etc. I just don't know where to even begin with this problem. Let me know what more I can provide.
Technical info