Skip to main content
All file paths are validated against ABSPATH using realpath(). Any path that resolves outside the WordPress root directory is rejected with a 403 error. The files wp-config.php, .htaccess, and index.php are protected and cannot be deleted or renamed.

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.
curl -X GET "https://example.com/wp-json/wp-manager-pro/v1/files?path=/var/www/html/wp-content/plugins" \
  -H "X-WP-Nonce: YOUR_NONCE"

Parameters

path
string
Absolute server path to the directory to list. Defaults to ABSPATH.

Response

path
string
The resolved, validated directory path.
writable
boolean
Whether the directory is writable.
breadcrumbs
array
Navigation breadcrumbs from the WordPress root to the current directory.
items
array
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).
curl -X GET "https://example.com/wp-json/wp-manager-pro/v1/files/read?path=/var/www/html/wp-config.php" \
  -H "X-WP-Nonce: YOUR_NONCE"

Parameters

path
string
required
Absolute path to the file to read.

Response

path
string
Resolved file path.
name
string
File name.
content
string
Full file content as a string.
ext
string
File extension.
size
integer
File size in bytes.
modified
integer
Last-modified Unix timestamp.
writable
boolean
Whether the file is writable.

POST /files/write

Writes content to an existing file. The file must be writable.
curl -X POST https://example.com/wp-json/wp-manager-pro/v1/files/write \
  -H "X-WP-Nonce: YOUR_NONCE" \
  -H "Content-Type: application/json" \
  -d '{"path": "/var/www/html/wp-content/my-file.txt", "content": "Hello, world!"}'

Parameters

path
string
required
Absolute path to the file to write.
content
string
required
New file content. Replaces the entire existing content.

Response

success
boolean
Always true on success.
message
string
Confirmation message.
bytes
integer
Number of bytes written.

DELETE /files/delete

Deletes a file or directory (recursively). The files wp-config.php, .htaccess, and index.php are protected and cannot be deleted.
curl -X DELETE https://example.com/wp-json/wp-manager-pro/v1/files/delete \
  -H "X-WP-Nonce: YOUR_NONCE" \
  -H "Content-Type: application/json" \
  -d '{"path": "/var/www/html/wp-content/temp-folder"}'

Parameters

path
string
required
Absolute path to the file or directory to delete.

POST /files/mkdir

Creates a new directory. The parent directory must exist and be within ABSPATH.
curl -X POST https://example.com/wp-json/wp-manager-pro/v1/files/mkdir \
  -H "X-WP-Nonce: YOUR_NONCE" \
  -H "Content-Type: application/json" \
  -d '{"path": "/var/www/html/wp-content/my-new-dir"}'

Parameters

path
string
required
Absolute path for the new directory to create.

Response

success
boolean
Always true on success.
message
string
Confirmation message.
path
string
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.
curl -X POST https://example.com/wp-json/wp-manager-pro/v1/files/upload \
  -H "X-WP-Nonce: YOUR_NONCE" \
  -F "file=@/local/path/to/file.txt" \
  -F "path=/var/www/html/wp-content/uploads"

Parameters

file
file
required
The file to upload.
path
string
required
Absolute path to the target directory on the server.

Response

success
boolean
Always true on success.
name
string
Sanitized filename as saved on the server.
path
string
Absolute path to the uploaded file.
size
integer
File size in bytes.

POST /files/rename

Renames a file or directory. The new name must not contain path separators. The files wp-config.php, .htaccess, and index.php cannot be renamed.
curl -X POST https://example.com/wp-json/wp-manager-pro/v1/files/rename \
  -H "X-WP-Nonce: YOUR_NONCE" \
  -H "Content-Type: application/json" \
  -d '{"path": "/var/www/html/wp-content/old-name.txt", "name": "new-name.txt"}'

Parameters

path
string
required
Absolute path to the file or directory to rename.
name
string
required
New name (filename only, no slashes). The file stays in the same directory.

Response

success
boolean
Always true on success.
message
string
Confirmation message.
new_path
string
Absolute path to the renamed file or directory.
name
string
The sanitized new name that was applied.

Build docs developers (and LLMs) love