You can now set custom webroots for your WordPress sites at Kinsta using our public API. This gives developers and agencies greater flexibility when managing deployments, version control, or customized site structures, without needing to contact support.
Previously, if you wanted to change a site’s webroot (for example, to support structures like Bedrock, where the public-facing folder is /public/web
), you had to open a support ticket. Now, you can handle it programmatically, saving time for teams managing multiple environments or complex workflows.
How to change your WordPress site’s webroot
To change a site’s webroot, send a POST
request to the Kinsta API’s /change-webroot-subfolder
endpoint for a specific environment.
Here’s an example POST
request:
curl -i -X POST \
'https://api.kinsta.com/v2/sites/environments/{env_id}/change-webroot-subfolder' \
-H 'Authorization: Bearer ' \
-H 'Content-Type: application/json' \
-d '{
"web_root_subfolder": "your_subfolder_name",
"clear_all_cache": true,
"refresh_plugins_and_themes": true
}'
In this request:
env_id
is the ID of the WordPress environment you want to update.web_root_subfolder
sets the new subfolder you want to use as the webroot (for example,release_v2
orweb
).clear_all_cache
(optional) determines whether the site’s cache should be cleared during the change. Defaults totrue
.refresh_plugins_and_themes
(optional) refreshes plugin and theme files to avoid conflicts after switching. Defaults totrue
.
Once you send the request, Kinsta updates the server configuration to point to the new subfolder. Additionally, it can clear the cache and refresh plugin and theme files if you have those options enabled.
After the process completes, the updated webroot path appears in your MyKinsta Environment details, as shown below.

WordPress management that fits your workflow
With the Kinsta API, you can do more than just set a custom webroot. Automate updates across multiple sites, integrate webroot changes into your deployment process, or even build tools like Slackbots to manage your environments on the fly.
It’s all about giving you more control — and making it easier to run WordPress sites the way you want.
Not a Kinsta customer yet? Check out our hosting plans to see what’s possible.