Media, menus, categories & tags
Nội dung này hiện chưa có sẵn bằng ngôn ngữ của bạn.
Four sections of a WordPress site’s content shell let you manage everything that
isn’t a post or page: the Media library (/sites/:srv/:dom/media), the
navigation Menus builder (/menus), and the Categories (/categories)
and Tags (/tags) taxonomies. They all read and write WordPress directly
through the site’s agent — no wp-admin login, no page-builder dependency, no child
plugin to install. Available on all plans for any WordPress site.
What each section does
Section titled “What each section does”- Media (
/media) — the site’s library in a grid or list view, read in one fast database query on the box (agent 0.2.123+). Filter by type and by chips with counts — missing alt, unattached, large, oversized — and sort. The list view edits alt text inline; the detail drawer edits Title, Alt text and Caption and shows where the file is used (featured image, post content, Elementor). Upload by dropping files on the page or with the button. Bulk-edit alt/caption or delete a selection (delete warns when files are in use). The toolbar’s Optimization drawer handles image compression (see below). - Menus (
/menus) — a two-column navigation workbench. Pick or create a menu on the left, then drag items into a nested tree on the right. Add Pages, Posts, Categories or a Custom link from the source panels, rename or remove items inline, nest them by dragging, and click Save changes to write the whole tree. Classic themes also expose Display location (assign the menu to the theme’s nav slots). - Categories (
/categories) — hierarchical taxonomy CRUD. Create, edit (Name · Slug · Parent · Description) and delete categories, nest them under a parent, and mark one as the site’s default category with the star action. - Tags (
/tags) — the same CRUD as categories but flat (no parent, no default).
Manage media, step by step
Section titled “Manage media, step by step”- Open Media from the site’s left rail.
- Upload: drop files on the page (or click Upload). Each file is compressed in
the browser with your account’s image defaults, sent straight to the box, then
registered with WordPress (
wp.media-import), which builds the sizes. Progress shows per file. - Use search, the type filter and the chips (missing alt, unattached, large, oversized) to narrow the library.
- Click a tile to open its details drawer. Edit the Title, Alt text and Caption, then Save — or Copy URL / Open the original.
- To act on many files, hover a tile and tick its checkbox (or Select all from the bulk dock). Then Edit alt / caption to apply the same values across the selection, or delete them.
Optimize images
Section titled “Optimize images”The Optimization drawer (Media toolbar) has two tabs.
- Optimize — a status card from an agent scan (image count, size, WebP coverage, heavy and oversized files, estimated saving, originals kept); a banner when another optimizer (EWWW, ShortPixel, …) is active, with an optional take-over; bulk optimize as a background job with live progress and Stop; Restore originals; and deleting kept originals older than 30 days.
- Settings — max size, quality, WebP/AVIF, thumbnails, keep originals, auto-optimize new uploads and delivery. Settings live on the box, so the upload queue keeps working while the control plane is unreachable.
Jobs: wp.images-scan, wp.images-optimize {domain, max?: 320–8192, quality?: 30–100, formats?: [webp, avif], thumbs?, keepOriginals?, recompress?}, wp.images-stop,
wp.images-restore {domain, path?}, wp.images-purge-originals {domain, olderThan},
wp.images-settings {domain, settings?}.
Build a menu, step by step
Section titled “Build a menu, step by step”- Open Menus. MZPanel auto-detects whether the active theme is classic or block, and drives the right backend for you.
- Pick a menu from the dropdown, or click + to create one.
- Expand a source panel (Pages / Posts / Categories / Custom link), tick the items you want and click Add — they append to the tree on the right.
- Drag items to reorder or nest them, rename or remove an item inline, and (classic themes) tick a Display location to place the menu in the theme.
- Click Save changes. Nothing is written to WordPress until you save — a yellow “Unsaved changes” bar lets you Discard instead.
How it works
Section titled “How it works”Writes are powered by one job kind, wp.content, which proxies the site’s native
WordPress REST API (wp/v2) through the agent; the media library list uses a fast
direct-database read (GET /v1/servers/:id/wp/media?scope=site&domain=), and uploads use
wp.media-import:
- The dashboard calls the API, which dispatches
wp.contentwith a method, awp/v2path and (for writes) a JSON body. - The agent runs
mz wp <domain> content <method> <path>natively. It resolves the site, ensures the embedded mzpanel-agent mu-plugin is installed and a per-site token exists (self-healing — no manual install step), then makes a localhost HTTPS call to the mu-plugin routemzpanel/v1/wp/<path>, which forwards towp/v2. - The mu-plugin’s JSON response is returned verbatim. The per-site token is read on the
box and sent as an
X-MZP-Tokenheader — it never leaves the server.
State lives entirely in WordPress: media are attachments, menus are the nav_menu
taxonomy (classic) or a core/navigation block (block themes), and categories/tags are
the category and post_tag taxonomies. The default category is stored in
WordPress Settings (default_category). MZPanel keeps no copy of any of it.
CLI & automation
Section titled “CLI & automation”Every action maps to mz wp <domain> content … on the box — the same engine the
dashboard drives. The <method> and <path> are a native wp/v2 REST call; writes
carry a JSON body via --data:
mz wp example.com content GET wp/v2/media --json # list mediamz wp example.com content GET wp/v2/categories --json # list categoriesmz wp example.com content POST wp/v2/tags --data '{"name":"featured"}' --jsonmz wp example.com content DELETE wp/v2/media/123 --json # delete attachment 123The path and body are a straight wp/v2 request, so anything the WordPress REST API
exposes (pagination, ?per_page=, menus, menu-items, navigation, settings, …)
works here. Always pass --json. See The mz CLI and the
command catalog.
Automate it (MCP / REST)
Section titled “Automate it (MCP / REST)”| Goal | MCP tool | REST / job |
|---|---|---|
Media library (filters: type, filter=missing_alt…) | wp_media_list | GET /v1/servers/{id}/wp/media?scope=site&domain= |
| Categories / tags | wp_terms_list | GET /v1/servers/{id}/wp/terms?scope=site&domain=&taxonomy=categories|tags |
| Edit media / terms / menus | jobs_create | wp.content with wp/v2/media/{id}, wp/v2/categories, wp/v2/menus, wp/v2/menu-items, wp/v2/navigation |
| Register an uploaded file | jobs_create | wp.media-import {domain, file, post?, title?, alt?} (file is a file name already staged in the site user’s ~/.mz-incoming) |
| Image optimization | jobs_create | wp.images-* |
Gotchas & troubleshooting
Section titled “Gotchas & troubleshooting”- Older agents get a simpler library. Before agent 0.2.123 the list falls back to
wp/v2/media: no filter chips and no counts. - Bulk edits on old mu-plugins run per item. Bulk alt/caption and delete run as one request on mu-plugin 0.3.16+, otherwise one request per file.
- Needs a WordPress site + the agent online. These sections read and write live through the agent and the mu-plugin. On other site types they don’t apply, and when the agent is offline you’ll see the site shell’s “agent offline” banner.
- The bridge installs itself. The first
wp.contentcall materializes the mzpanel-agent mu-plugin and mints a per-site token automatically. If it can’t (a locked-down filesystem, for example) the section shows a “bridge install failed” error pointing atmz wp <domain> agent install. - Menu edits are all-or-nothing until you save. Reordering, renaming and removing items only touch the in-memory tree; Save changes reconciles the whole menu in one pass. Leaving without saving discards the edits.
- The default category can’t be deleted. Its delete action is disabled; make a different category the default first, then delete the old one. Deleting any other category re-homes its orphaned posts onto the default.
Related
Section titled “Related”- Site overview — the per-site health cockpit and content counts.
- WP & AI content — managing posts and pages.
- The mz CLI — driving a site from the command line.