Skip to content
Learnomy

SEO Plugin Handoff

Learnomy prints its own canonical links, Open Graph tags, and Schema.org structured data on every course, catalog, category, instructor, and certificate page, so search engines and social previews work even on a site with no SEO plugin installed. When you also run Yoast SEO or Rank Math, Learnomy automatically steps aside on the parts those plugins already own, so you never get two competing canonical links or two sets of Open Graph tags on the same page.

What happens automatically

There is nothing to configure. As soon as Yoast SEO or Rank Math is active, Learnomy:

  • Stops printing its own canonical link on course, catalog, category, instructor-profile, and certificate-verify pages. Yoast or Rank Math's canonical takes over.
  • Stops printing its own Open Graph tags (og:title, og:description, og:url, og:image, og:site_name) on the same pages. Yoast or Rank Math's OG output takes over.
  • Keeps printing its own Schema.org structured data on those pages, because it is data those general-purpose SEO plugins don't generate: Course markup (with price, rating, and instructor) on a course page, an ItemList on the catalog, a CollectionPage on a category archive, a Person profile on an instructor page, and an EducationalOccupationalCredential on a certificate verification page.

In other words, Learnomy always keeps its course-specific structured data, and only yields the general-purpose canonical/OG tags to whichever SEO plugin is already handling them for the rest of the site.

Detecting an active SEO plugin

Learnomy checks for Yoast SEO (WPSEO_VERSION or the WPSEO_Frontend class) and Rank Math (RankMath class or RANK_MATH_VERSION). If either is active, Learnomy yields its canonical + Open Graph output. If neither is active, Learnomy prints its own canonical and Open Graph tags as usual, so a site with no SEO plugin still gets correct link previews and canonical URLs out of the box.

Which pages this applies to

Page Structured data Learnomy always emits Canonical + OG (yielded when Yoast/Rank Math is active)
Course (/courses/:slug/) Course (price, rating, instructor, course instance) Yes
Catalog (/courses/) ItemList of published courses Yes
Category archive CollectionPage Yes
Instructor profile Person Yes
Certificate verification (/verify/:uuid/) EducationalOccupationalCredential Yes

For developers

The decision is filterable with learnomy_seo_yield_to_plugin, in case you want to override the auto-detection - for example to keep Learnomy's own canonical and Open Graph tags even with Yoast or Rank Math active, or to force yielding for an SEO plugin Learnomy doesn't auto-detect.

// Force Learnomy to keep printing its own canonical + OG tags,
// even though Yoast or Rank Math is active.
add_filter( 'learnomy_seo_yield_to_plugin', function ( bool $should_yield ) {
    return false;
} );

The filter receives the auto-detected boolean and returns the final decision; the structured-data (JSON-LD) output is never affected by it.

Related