# Write and tidy content

> Draft posts and pages, make small exact edits, add images, schedule and publish after your approval, and tidy categories and tags. Changes are recorded.

Your AI app can write drafts, make small exact edits to existing text, add images, schedule posts and tidy categories and tags. It saves drafts by default and publishes only when you say so. Changes are recorded, so you can roll them back.

## What you need

- **Content & store data**, which the Content manager preset has. That covers posts, pages, products, categories, tags and media.
- On the Free plan your AI app can read and plan, but it cannot save.
- On a team, give each writer their own connection with the Content manager preset. See [Several AI apps and a team](/docs/guides/team/).

## Before you start

- Teach your AI app your voice once. Under **PowerWP AI › Memory** you keep rules ("never change published dates"), facts about your business and notes. AI apps propose entries, and nothing takes effect until you approve it, unless you have let trusted connections save directly. Ask your AI app: `Set up the site memory`, and answer its questions about tone, key pages and what it must never do.
- Give it the facts. It must not invent facts, quotes, sources or numbers. Anything it cannot verify is marked `[CHECK]` and is not applied.
- Set a checkpoint before several edits (see [Work safely on a live site](/docs/guides/safe-workflow/)).

## Steps

:::steps
1. **Look at what exists.** Avoid duplicates, and find drafts that went stale.
   - Example prompt: `List my drafts older than 30 days and my five oldest published posts. Also check whether we already have a post about cast iron care.`
   - Your AI app will use `content_query` and `terms_query`.
2. **Write a draft.** Ask for the exact text first.
   - Example prompt: `Draft a post called "How to season a cast iron skillet" from these notes: [paste]. Use only existing categories and tags. Show me the headline, slug, excerpt, body, categories and the featured image idea. Don't save yet.`
   - Your AI app will use `terms_query`. Terms are used as ids from your existing list, so names do not create new categories by accident.
3. **Save it as a draft.**
   - Example prompt: `Save it as a draft by Ana, with that featured image, and add alt text.`
   - Your AI app will use `checkpoint_create`, `content_create` (the status defaults to draft) and `media_import` for a new image from an address or a file on the server. Alt text is set when the image is imported.
4. **Edit existing text with small changes.** The app replaces exact phrases and leaves the rest alone.
   - Example prompt: `On the About page, change "since 2014" to "since 2012". Show me a dry run first. Don't touch the slug, the status or the date.`
   - Your AI app will use `content_get` and `content_update` with `content_edits` and `dry_run`. For a page built with Elementor, see the [Elementor guide](/docs/guides/elementor/).
5. **Publish or schedule, only on a clear yes.**
   - Example prompt: `Schedule it for Friday 09:00, site time.`
   - Your AI app will use `content_update` with the status `future` and a date in the future, in site time. A past date is refused. Since PowerWP AI 1.6, a draft that never had a date is scheduled instead of going live at once. `cron_events` shows the scheduled publication.
   - If a newsletter or social auto-post plugin is active, your AI app warns you first. Publishing can send e-mails or social posts that a rollback cannot recall.
6. **Tidy categories and tags.** Merge duplicates and remove unused terms in small approved steps.
   - Example prompt: `Find duplicate, empty and single-use categories and tags. Show me a plan, including which archive addresses would disappear. Merge nothing yet.`
   - Your AI app will use `terms_query`, `content_query`, `content_update` (moving posts to the other term) and `term_manage`. Merging or deleting a term removes its archive address, so a redirect may be needed. The AI app lists them, but redirects are made in your redirect plugin.
7. **Check.**
   - Example prompt: `Confirm status, date and slug of the post, check the page on the live site and look for new errors.`
   - Your AI app will use `content_get`, `page_check` and `error_log_read`.
:::

## For news sites, magazines and blogs

PowerWP AI switches on a content pack when your site has 25 or more published posts, or 5 or more in the last 60 days. It adds recipes for the editorial routine, and setup questions about style guide, sources, corrections, image rights, publishing schedule, bylines and newsletter. Answer them once in **Memory**, and every AI app follows them.

## Check the result

- `content_get` shows the right status, date and final slug. A scheduled post shows `future` and a date.
- The page loads at its address with the new text.
- **PowerWP AI › Changes** lists the edits with their change ids.

## How to undo

- A **created** item is deleted again by the rollback. An **edited** item returns to its earlier state. WordPress keeps a revision of each edit, and an undo leaves that revision in place.
- A **deleted** item (`content_delete` moves it to the trash; permanent deletion is recorded as well) can be rolled back with its meta, terms, comments and child posts.
- A **deleted term** comes back with its meta and its relationships.
- An **imported image** is removed from the Media Library by a rollback. The files stay in the uploads folder.
- If someone edited the item again since, the rollback stops with a conflict so it does not overwrite that work.
- E-mails, newsletters and social posts sent because a post was published cannot be recalled.

## Recipes that do this

- [publish_article](/docs/reference/recipes/#publish_article) takes an article from draft to publication, with taxonomy, alt text and meta description.
- [refresh_article](/docs/reference/recipes/#refresh_article) and [content_refresh](/docs/reference/recipes/#content_refresh) update older text and keep the address.
- [tidy_taxonomy](/docs/reference/recipes/#tidy_taxonomy) and [internal_links](/docs/reference/recipes/#internal_links) clean up categories and add links.
- [editorial_queue](/docs/reference/recipes/#editorial_queue), [authors_and_bylines](/docs/reference/recipes/#authors_and_bylines) and [news_discover_readiness](/docs/reference/recipes/#news_discover_readiness) are read-only reviews.
- [corrections_log](/docs/reference/recipes/#corrections_log) adds a dated correction note after you approve the wording, and [newsletter_digest](/docs/reference/recipes/#newsletter_digest) drafts a digest. Nothing is sent.
- [setup_memory](/docs/reference/recipes/#setup_memory) saves your voice and rules.

:::cards
- [Site memory](/docs/concepts/memory/) — Rules and facts for every AI app.
- [SEO audit and fixes](/docs/guides/seo/) — Titles, descriptions and links.
- [Work safely on a live site](/docs/guides/safe-workflow/) — The routine behind these steps.
- [Recipes](/docs/concepts/recipes/) — How the content pack works.
:::

Source: https://powerwp.ai/docs/guides/content/
