Hi Mohit Gupta ,
Welcome to the Microsoft Q&A Platform!
When creating a deployment slot for a WordPress app in Azure App Service, the wp-content
folder (containing themes, plugins, and uploads) is not copied, even when cloning settings. This results in missing themes and plugins.
The main root cause
- Deployment slots clone configuration settings but do not clone the file system by default.
- The
wp-content
directory is part of the app's file system and must be explicitly copied. - Each slot has an isolated file system unless shared storage is configured.
You can cross check with these steps: - Offload
wp-content/uploads
to Azure Blob Storage using plugins like "Microsoft Azure Storage for WordPress". - Access the app's file system via Kudu Console, FTP, or Azure Storage Explorer.
- Copy the
wp-content
directory from the original app to the new slot. - Create a script to copy the
wp-content
directory during slot creation. - Use CI/CD pipelines to handle syncing automatically.
- Include
wp-content
in your repository or deployment pipeline to ensure it is deployed with the app. - Manually copy additional plugins/themes installed after deployment.
- Test the slot against the production slot’s
wp-content
during a swap.
After making changes, verify that - The
wp-content
folder exists in the deployment slot. - The database is correctly pointing to the cloned deployment slot.
- The necessary plugins and themes are active without errors.
- Use the WordPress debug log (
wp-config.php
) to confirm no missing files are referenced.
ref link:https://learn.microsoft.com/en-us/azure/app-service/deploy-staging-slots?tabs=portal
https://learn.microsoft.com/en-us/azure/storage/blobs/blob-upload-function-trigger?tabs=azure-portal
https://learn.microsoft.com/en-us/azure/app-service/deploy-ftp?tabs=portal
By implementing one of these fixes, you can ensure that your WordPress deployment slot has access to thewp-content
directory and functions as expected.
Let mi know if you have any assistances.
If the answer is helpful, please click Accept Answer and kindly upvote it so that other people who faces similar issue may get benefitted from it.