Skip to main content

How to add additional content for Yoast SEO Content analysis

Yoast’s default SEO analysis only covers the main content field. If your WordPress site uses custom fields (e.g. ACF, builder content), you’ll want Yoast to analyze that too. Here’s a way to inject arbitrary content into Yoast’s analyzer using a PHP AJAX handler and a JavaScript plugin.
Save the provided JavaScript code as a file in your theme directory, for example:
/wp-content/themes/your-theme/js/yoast-analysis.js

Then add the provided PHP script to your theme (or a custom plugin).
It registers an AJAX handler that outputs the post’s entire content—main field plus any custom fields you choose (just extend the content concatenation area). Make sure to update the field references as appropriate for your use case.

Leave a Reply

Your email address will not be published. Required fields are marked *

Please don’t paste any HTML, Js or PHP code into comments box, use pastebin.com or similar service to share code examples.

Characters left: 1000