Skip Navigation

[Resuelto] SEO by Yoast doesn't find my custom post type fields

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 6 respuestas, has 2 mensajes.

Last updated by christerA hace 6 años, 8 meses.

Assigned support staff: Minesh.



Love Toolset. I have a question about SEO by Yoast. I have created a custom post type with Toolset with
"description", "excerpt", "date", etc.

And i have filled in keyword, meta, etc in Yoast. But when i click Page Analysis in Yoast it says "0 words in the content" (and with the red dot...)

It seems Yoast doesn't find the content in my "description" field although i have lots of words in it.

What have i missed?



Languages: Inglés (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello and thank you for contacting support forum.

Could you please send me few screenshots explaining your issue or steps to reproduce your issue.

I would like to have debug information that will help us to debug and investigate your issue:



Thank you for answering.
To reproduce the problem:
- Install Types
- Install WordPress SEO by Yoast
- Create a custom post type
- Create a custom field, like "description"
- Create a post with that custom post type
- Type in some text in "description"
- Below that area (or above) you will see a widget called "WordPress SEO by Yoast"
- Fill in Focus-keyword, SEO-title and Meta
- Save the page
- Go back to the widget and click "Page analysis"
- Then you will see a red dot and "0 words in content...."

Thats it. WordPress SEO by Yoast can't find the "description" text. For "normal" pages, that is, not custom post type pages, it works fine.

I have contacted Yoast but they only give support if you buy the premium version of their plugin.....



Languages: Inglés (English )

Timezone: Asia/Kolkata (GMT+05:30)

I checked your issue at this end on my local and I could not able to reproduce your issue, Could you please send me debug information.



I finally got a reply from Yoast:
Thanks for emailing us! In a way, Types acts much like a page builder. So in regards to that, by default, our plugin does not analyze content that is outside of the main content box of a page or post. Some visual composer developers have modified their code to add compatibility with our plugins while others have not.
If you are using a plugin or theme that doesn't send their content to our page analysis, please reach out the developer and ask them about adding the functionality to their visual builder.
Additionally, our Knowledge Base touches up on this - hidden link
Basically you'd have to put together a filter so those content blocks will be picked up.
Click on the links they supplied.
The code below is at: hidden link

I tried the code they suggested:

function yst_custom_content_analysis( $content ) {
global $post;
return $content . ' ' . get_post_meta( $post->ID, '_yoast_postmeta_example', true );
add_filter( 'wpseo_pre_analysis_post_content', 'yst_custom_content_analysis' );

I still didn't get it to work.
If i create a custom post type with Types with the name "myposttype" and add a custom field named "mydescription". And fill in some text in that field.
What exactly shall i put in the code above to make Yoast "Page analysis" find that text?

I tried an alternative to using a custom field for the main text. When i created the custom post type above, I did NOT click "Editor". (in the section with the checkboxes "Title", "Editor", "Comments", ...etc)
When i checked the "Editor" field and then copied my text from the "mydescription" custom field area to the normal "Editor" area, it worked! Yoast found it in "Page analysis".
But it would be very nice if it found All my custom fields.



Languages: Inglés (English )

Timezone: Asia/Kolkata (GMT+05:30)

I have tested below code and add to the current theme's functions.php file. where "wpcf-summary" is the custom field for me.

function yst_custom_content_analysis( $content ) {
global $post;
return $content . ' ' . get_post_meta( $post->ID, 'wpcf-summary', true );
add_filter( 'wpseo_pre_analysis_post_content', 'yst_custom_content_analysis' );

Can you please try to put your custom field instead of 'wpcf-summary' and check your issue. Its working at this end.