How to determine, from plugin script, if active theme has The Post Title

My plugin needs to know if the currently active theme places the post title in H1 heading tags? I’m looking for suggestions on approaches to create script that could discern this.

UPDATE: The plugin evaluates the SEO profile of the post content to help the user make improvements for search rankings. Second only to the post title, the h1 tag is one of the most important tags for SEO. However, I don’t want to ask the user to include their primary keyword in an h1 heading tag in the post content if the theme already does that (as many do).

2 Answers
2

Send an HTTP request to the page and search the response body for </h1>.
See this Gist for an example.

Store the result in an option and delete this option when the user switches the theme (hook into the action switch_theme).

Leave a Comment