Find (and optionally update) content by URL
find_content_by_urlGiven a WordPress URL, find the content behind it by detecting the post type from the URL shape, and optionally update that content in the same call.
Instructions
Resolve any WordPress front-end URL to the content behind it, detecting the post type from the URL shape (so /documentation/getting-started/ finds the documentation custom post type), then optionally update it in the same call. This is the tool to reach for when a human hands you a link. Detection tries, in order: an explicit ?p= id, the site's own search index, the registered rewrite base, then a slug sweep across every type.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Any URL on the site — permalink, ?p=123, or a pretty CPT URL. | |
| date | No | Publish date in site time, ISO 8601 (2026-01-31T09:00:00). With status "future" this schedules the post. | |
| meta | No | Custom fields, as key/value pairs. A key only writes if it is registered with show_in_rest — use set_content_meta for unregistered keys. | |
| slug | No | URL slug. Changing this on published content breaks existing links unless you add a redirect. | |
| edits | No | Targeted find/replace edits applied to the existing content, so you can change one paragraph without resending the whole document. Edits apply in order. Mutually exclusive with `content`. | |
| terms | No | Taxonomy assignments keyed by taxonomy REST base, e.g. {"categories": [3], "tags": ["news"]}. Names that do not exist yet are created. | |
| title | No | The title, as plain text. | |
| author | No | User ID of the author. | |
| format | No | Post format: standard, aside, gallery, link, image, quote, status, video, audio, chat. | |
| parent | No | Parent ID, for hierarchical types such as pages. | |
| status | No | publish | future | draft | pending | private | trash. | |
| sticky | No | Pin the post to the top of the blog. Posts only. | |
| update | No | Apply the supplied changes once the content is found. Off by default, so this tool is safe to use purely for lookup. | |
| content | No | Full content body, replacing whatever is there. For the block editor this is block markup (<!-- wp:paragraph --><p>…</p><!-- /wp:paragraph -->); classic content is plain HTML. Use `edits` instead for a small change. | |
| excerpt | No | Hand-written excerpt. | |
| site_id | No | Which configured WordPress site to act on. Optional — with a single site configured it is used automatically; with several, the default site is used unless you name one. Run list_sites for valid ids. | |
| password | No | Password-protect the content. | |
| template | No | Page template file, e.g. "templates/full-width.php". | |
| menu_order | No | Sort order for hierarchical types. | |
| ping_status | No | Whether pingbacks and trackbacks are accepted. | |
| comment_status | No | Whether comments are open on this item. | |
| featured_media | No | Attachment ID of the featured image. Upload it with create_media first. | |
| include_content | No | Return the full body along with the match. |