Skip to main content
Glama
yoast.ts1.51 kB
/** * Yoast SEO Settings Extractor * * Extracts Yoast SEO settings from wp_options. * * @package WP_Navigator_Pro * @since 2.1.0 */ import type { PluginSettingsExtractor } from './types.js'; /** * Core Yoast SEO options to extract */ const CORE_OPTIONS = ['wpseo', 'wpseo_titles', 'wpseo_social', 'wpseo_ms']; /** * Option keys to exclude (sensitive or not useful for sync) */ const EXCLUDED_KEYS = [ 'wpseo_license', 'wpseo_premium', 'wpseo_notification', 'wpseo_indexation', 'wpseo_wincher', ]; export const yoastExtractor: PluginSettingsExtractor = { slug: 'wordpress-seo', displayName: 'Yoast SEO', optionPrefixes: ['wpseo_', 'wpseo-'], shouldInclude(optionName: string): boolean { // Include core options and any starting with wpseo_ but not excluded if (CORE_OPTIONS.includes(optionName)) return true; if (EXCLUDED_KEYS.some((ex) => optionName.startsWith(ex))) return false; return optionName.startsWith('wpseo_') || optionName.startsWith('wpseo-'); }, extract(options: Record<string, unknown>): Record<string, unknown> { const result: Record<string, unknown> = {}; for (const [key, value] of Object.entries(options)) { // Skip excluded keys if (EXCLUDED_KEYS.some((ex) => key.startsWith(ex))) continue; // Include core options and relevant wpseo_ options if (CORE_OPTIONS.includes(key) || key.startsWith('wpseo_') || key.startsWith('wpseo-')) { result[key] = value; } } return result; }, };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/littlebearapps/wp-navigator-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server