Xdebug in WordPress Studio
WordPress Studio includes Xdebug support for local sites. Xdebug is a debugging extension for PHP that enables you to set breakpoints, inspect variables, and step through your code.
Enabling Xdebug
- Select the site you want to debug.
- Navigate to the Settings tab.
- Click “Edit site.”
- Navigate to the “Debugging” tab.
- Check the “Enable Xdebug” checkbox.
- Click Save.
The site will restart automatically with Xdebug enabled.
Important limitations
- Only one site at a time: Xdebug can only be enabled for a single site at once. To enable it for a different site, you must first disable it on the current site.
- Performance impact: Xdebug may slow down site performance. Disable it when not actively debugging.
Using Xdebug with your IDE
Once Xdebug is enabled for a site, you can connect your IDE (code editor) to debug WordPress plugins, themes, and core code.
Studio’s default Native PHP runtime usually does not require path mapping in your editor. If your site uses the Sandbox runtime, configure path mapping from Studio’s /wordpress server path to your local site folder.
Visual Studio Code setup
- Install the PHP Debug extension.
- Create a
.vscode/launch.jsonfile in your project:
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003
}
]
}
- If your site uses the Sandbox runtime, add
pathMappingsto the configuration:
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003,
"pathMappings": {
"/wordpress": "${workspaceFolder}"
}
}
]
}
- Set breakpoints in your code.
- Start the debugging session in Visual Studio Code (Run → Start Debugging).
- Navigate to your site in the browser to trigger the breakpoints.
PhpStorm Setup
- Go to Settings → PHP → Debug.
- Verify that the Xdebug port is set to 9003.
- To stop breaking at the first line:
- Disable “Force break at first line when no path mapping specified”
- Disable “Force break at first line when a script is outside the project”
- If your site is using the Sandbox runtime, configure path mappings:
- PhpStorm may ask you to configure path mappings when the first Xdebug connection is received.
- Map Studio’s
/wordpressserver path to your local Studio site folder. - You can also configure this manually in Settings → PHP → Servers.
- Enable “Start listening for PHP Debug Connections” from the toolbar.
- Set breakpoints in your code.
- Navigate to your site in the browser to trigger the breakpoints.
Learn more
For more details about how Xdebug works with the Sandbox runtime, see the WordPress Playground Xdebug documentation.
Studio does not support WordPress Playground’s experimental flags or Chrome DevTools integration at this time.
Last updated: July 08, 2026