list of signal constants/classes. First // match wins. Covers the top SEO plugins on WordPress.org by install count. $signals = array( 'Yoast SEO' => array( 'WPSEO_VERSION' ), 'Rank Math' => array( 'RANK_MATH_VERSION', 'RankMath\\Plugin' ), 'All in One SEO' => array( 'AIOSEO_VERSION', 'AIOSEO\\Plugin\\AIOSEO' ), 'SEOPress' => array( 'SEOPRESS_VERSION' ), 'The SEO Framework' => array( 'THE_SEO_FRAMEWORK_VERSION', 'The_SEO_Framework\\Load' ), 'Slim SEO' => array( 'SLIM_SEO_VERSION', 'Slim_SEO\\Plugin' ), 'Squirrly SEO' => array( 'SQ_VERSION', 'SquirrlySEO' ), 'Schema Pro' => array( 'WPSP_VER', 'BSF_AIOSRS_Pro_Markup' ), 'Schema & Structured Data' => array( 'SASWP_VERSION', 'Saswp_Schema' ), ); $detected = null; foreach ( $signals as $name => $tokens ) { foreach ( $tokens as $token ) { if ( defined( $token ) || class_exists( $token ) ) { $detected = $name; break 2; } } } /** * Filter the detected SEO plugin name. * * Return a non-empty string to declare a plugin we don't auto-detect, * or boolean false to force our JSON-LD on regardless of detection. * * @param string|null $detected Plugin display name, or null if none found. */ $detected = apply_filters( 'ajaco_active_seo_plugin', $detected ); if ( $detected === false || ! is_string( $detected ) ) { $detected = null; } $cached = $detected ?? ''; return $detected; }