Skip to content
Coding Script or NotebookGoogle ColabFree

Entity-first Meta Descriptions with Claude, Reviewed and Imported to WordPress

ForEntity SEOContent audits

By Lazarina Stoy· Updated 5 Dec 2026

A meta description is one of the few places you can state, in a sentence, what a page is about. This free Python script uses Claude to draft one per page that names the page’s intended entity early, checks each draft in code, and gives you a review sheet. A small WordPress import script then writes only the ones you approved.

Who it’s for

SEOs on WordPress sites with Rank Math or Yoast who want to fix descriptions at scale without publishing anything unread.

How to use it

  1. Open the course scripts notebook in Colab (or download the folder from GitHub to run it on your computer).
  2. Add the keys the script needs as Colab secrets, with notebook access switched on. They never go into the code.
  3. Run the Setup cell. It downloads the scripts and installs what they need.
  4. Upload page_entity_profiles.csv from the Entity Extractor and a pages.csv with url, title, meta description and main content.
  5. Run it with --limit 5, read all five rows, then run the rest.
  6. In review.csv, set each decision to approve, edit or reject.
  7. Run import_meta.php with WP-CLI as a dry run, then again with apply.

What you get

  • Drafts of 120 to 155 characters that name the intended entity within the first ten words
  • Checks a person shouldn’t do by eye: length, entity position, and any number that isn’t on the page
  • A flag and a reason when the page text doesn’t support a good description
  • An import that keeps the old value in post meta, so every change can be reversed

Limits and costs

  • It needs an Anthropic API key, billed per use to your own account. A run is small, but start with five pages.
  • The import needs WP-CLI access to the site.
  • The prompt asks Claude not to invent claims, and the number check catches some that slip through. Read every row anyway.

Why entity-first

The meta description is often the snippet a person reads first, and a clear statement of what the page is about. Naming the intended entity early, in exactly the form your naming table uses, supports the Clarity fixes the audit found, without changing a word of the page itself.

Rank Math and Yoast are both detected automatically.

Comparing methods? See the meta description generator notebook. The scripts are on GitHub; the The AI-powered Entity Audit course shows how this fits Clarity fixes across a whole site.

What’s included

  • Claude drafts a meta description per page, naming the intended entity in the first ten words
  • Code checks length, entity position and every number against the page text
  • A review sheet with old and new side by side and a decision column
  • WP-CLI import for Rank Math or Yoast: dry run first, old value kept
  • Start with –limit 5