GET /files
Lists the contents of a directory. Defaults to the WordPress root (ABSPATH) if no path is provided. Directories are returned before files; all entries are sorted alphabetically.
Parameters
Absolute server path to the directory to list. Defaults to
ABSPATH.Response
The resolved, validated directory path.
Whether the directory is writable.
Navigation breadcrumbs from the WordPress root to the current directory.
Files and directories in the listed path.
GET /files/read
Reads the content of a text file. Files larger than 2 MB are rejected. Only text-based file types are supported (.php, .js, .ts, .css, .html, .json, .xml, .txt, .md, .yml, .env, .htaccess, .conf, .log, .svg, and others).
Parameters
Absolute path to the file to read.
Response
Resolved file path.
File name.
Full file content as a string.
File extension.
File size in bytes.
Last-modified Unix timestamp.
Whether the file is writable.
POST /files/write
Writes content to an existing file. The file must be writable.Parameters
Absolute path to the file to write.
New file content. Replaces the entire existing content.
Response
Always
true on success.Confirmation message.
Number of bytes written.
DELETE /files/delete
Deletes a file or directory (recursively). The fileswp-config.php, .htaccess, and index.php are protected and cannot be deleted.
Parameters
Absolute path to the file or directory to delete.
POST /files/mkdir
Creates a new directory. The parent directory must exist and be withinABSPATH.
Parameters
Absolute path for the new directory to create.
Response
Always
true on success.Confirmation message.
Absolute path to the created directory.
POST /files/upload
Uploads a file to a target directory on the server.This endpoint requires
multipart/form-data encoding.Parameters
The file to upload.
Absolute path to the target directory on the server.
Response
Always
true on success.Sanitized filename as saved on the server.
Absolute path to the uploaded file.
File size in bytes.
POST /files/rename
Renames a file or directory. The new name must not contain path separators. The fileswp-config.php, .htaccess, and index.php cannot be renamed.
Parameters
Absolute path to the file or directory to rename.
New name (filename only, no slashes). The file stays in the same directory.
Response
Always
true on success.Confirmation message.
Absolute path to the renamed file or directory.
The sanitized new name that was applied.
