-
Hey, Rank Math Support Team!
I’m using a Gutenberg (Block) theme and have created several custom PHP page templates, which are assigned to specific pages. These templates contain rich, static HTML content following proper on-page SEO practices that Rank Math generally recommends.
However, since the content is not within the default WordPress editor (i.e.,
post_content
), Rank Math doesn’t seem to detect it, resulting in a low SEO score (around 40) for all those pages.To address this, I attempted to use the
rank_math/frontend/content
filter like this:// Hook only in admin area (editor or REST API) if ( is_admin() || defined( 'REST_REQUEST' ) ) { add_filter( 'rank_math/frontend/content', 'mysite_rankmath_frontend_content' ); }
The callback function includes the PHP template, captures its output, and returns the rendered content so Rank Math can analyze it. Unfortunately, this approach doesn’t seem to update the SEO score in the admin/editor area.
Could you please:
* Confirm whether I’m using the correct hook and approach?
* Let me know if there’s an officially supported way to load and verify template-based content in the Rank Math content analyzer, especially for block themes?Looking forward to your guidance.
Thank you.
The ticket ‘Issue with SEO Score for Pages Using PHP Templates in Gutenberg (Block Theme)’ is closed to new replies.