dd_id_8e8d3ede5b
5. Documentation (Meta)
WordPress Ops (Codex)
Table of Contents
Ops
This page is written for Codex (automation), not for humans. It captures lessons learned and tips that reduce trial-and-error when maintaining the WordPress setup.
Lessons Learned
- WordPress runs in Docker; the config and content that must be preserved live outside the container.
- Bind-mount these server paths into the WordPress container:
/var/www/devdocs_wp/wp-config.php/var/www/devdocs_wp/wp-content/mu-plugins//var/www/devdocs_wp/wp-content/_view_engine//var/www/devdocs_wp/wp-content/plugins//var/www/devdocs_wp/wp-content/themes/- Mount
/var/www/config.xmlinto the WordPress container read-only so plugins can read admin settings. - The Codex admin auto-login depends on
admin/ipin/var/www/config.xmland the container seeing the real client IP. - If auto-login fails, log the request IPs (
REMOTE_ADDR,HTTP_X_REAL_IP,HTTP_X_FORWARDED_FOR) and compare toadmin/ip.
Useful Tips (Codex)
- Treat
/var/www/devdocs_wpas the WordPress data root (config, plugins, themes). - Keep local mirror paths in
server/var_www/devdocs_wpand sync viapython3 scripts_local/sync_unified.pyorpython3 scripts_local/publish_devdocs.py. - When changing container mounts, recreate containers with
docker compose up -d --force-recreate. - Use the database container for direct SQL when WP-CLI is unavailable.
- If you must activate a plugin without WP-CLI, update
wp_options.active_pluginsdirectly. - After DevDocs issue fixes, verify live behavior with
curlbefore claiming success.
Debugging Playbook
- Check that
/var/www/config.xmlis mounted inside the container. - Check that
wp-content/mu-pluginsandwp-content/_view_engineare mounted inwordpress-appwhen Twig-based rendering/plugins fail. - Verify the admin auto-login plugin is active in
wp_options.active_plugins. - Use the plugin log to see the IP mismatch and adjust logic if needed.
Safety
- Avoid copying full WordPress folders back and forth.
- Keep the server clean; only mirror the intended WordPress data folders.