Skip to content

Lightweight WP plugin to access Yoast SEO, Rank Math, and custom meta fields via the WordPress REST API. Ideal for AI content tools, headless WordPress, and SEO automation.

License

Notifications You must be signed in to change notification settings

partho5/nany-article-wp

Repository files navigation

Nany Article WP – SEO Meta for REST API

Nany Article WP is a simple WordPress plugin that lets you get Yoast SEO, Rank Math, and custom meta fields using the WordPress REST API.

This plugin works with πŸ”— Nany Article – an AI-powered tool that writes expert-level SEO articles in minutes.

πŸ’‘ Why is this useful?

  • If you use Nany Article, this plugin lets it auto-publish content on your site.
  • It also enables Application Passwords, which are needed for REST API access.
  • Your Yoast and Rank Math SEO data will be available in API responses.

πŸš€ What This Plugin Does

  • Adds SEO data (Yoast & Rank Math) to REST API responses.
  • Lets AI tools post on your site (if REST API is enabled).
  • Works for headless WordPress, automation, and SEO tools.

πŸ”§ How to Install

  1. Download & install the plugin in WordPress.
  2. Activate it from the WordPress plugins menu.
  3. Enable REST API & Application Passwords (needed for AI tools).
  4. Use the API to get SEO meta data.

πŸ“Œ How to Use the API

Once the plugin is active, you can get SEO meta data for any post. You have to have Yoast or RankMath plugin installed & activated first.

πŸ‘‰ Example API Requests:

πŸ” Get SEO Meta Data (Yoast & Rank Math)

GET {wordpress-installed-URL}/wp-json/wp/v2/posts/{id}

Response:

{
  "id": 123,
  "title": "Sample Post",
  "yoast_meta": {
    "yoast_wpseo_focuskw": "Focus Keyword",
    "yoast_wpseo_metadesc": "SEO Meta Description"
  },
  "rank_math_meta": {
    "rank_math_focus_keyword": "Focus Keyword",
    "rank_math_description": "SEO Meta Description"
  }
}

✍️ Set SEO Meta Data (Yoast & Rank Math)

POST {wordpress-installed-URL}/wp-json/wp/v2/posts/{id}

Headers:

{
  "Authorization": "Basic YOUR_ENCODED_CREDENTIALS",
  "Content-Type": "application/json"
}

Body:

{
  "title": "Your Article Title",
  "content": "This is the body of your WordPress post.",
  "status": "publish",
  
  "yoast_meta": {
    "yoast_wpseo_focuskw": "New Focus Keyword",
    "yoast_wpseo_metadesc": "New SEO Description"
  },
  
  "rank_math_meta": {
    "rank_math_focus_keyword": "New Focus Keyword",
    "rank_math_description": "New SEO Description"
  }
}

πŸ”— Works Best With Nany Article

If you use Nany Article, this plugin lets it auto-publish AI-generated content directly to your WordPress site!

This plugin is a fork of DevinVinson/WordPress-Plugin-Boilerplate.

About

Lightweight WP plugin to access Yoast SEO, Rank Math, and custom meta fields via the WordPress REST API. Ideal for AI content tools, headless WordPress, and SEO automation.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published