Skip to content

Instantly share code, notes, and snippets.

@emaildano
Created January 31, 2014 02:51
Show Gist options
  • Save emaildano/8725832 to your computer and use it in GitHub Desktop.
Save emaildano/8725832 to your computer and use it in GitHub Desktop.
Add ACFs to Yoast SEO page analysis.
function add_custom_content_to_analysis( $content ) {
global $post;
$custom = get_post_custom( $post->ID );
$custom_content = '';
foreach( $custom as $field )
{
$custom_content .= $field[0].' ';
}
return $content . ' ' . $custom_content;
}
add_filter( 'wpseo_pre_analysis_post_content', 'add_custom_content_to_analysis' );
// source
// http://wordpress.org/support/topic/how-to-wpseo_pre_analysis_post_content#post-4843463
@andrewmcnaughton
Copy link

Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment