Home / Guides / WordPress handbook / Chapter 12
WordPress handbook · Chapter 12 · Quick reference
Quick Reference
The commands, constants, paths and codes from the rest of the manual on one page. Each command has a copy button. Run commands from the WordPress root directory, replace example values, and read what a command does before running it on production.
On this page
WP-CLI commands
| Task | Command | Changes data? |
|---|---|---|
| Environment summary | wp --info | No |
| Core version / updates available | wp core version --extra · wp core check-update | No |
| Verify core files | wp core verify-checksums | No |
| Verify plugin files (WordPress.org plugins) | wp plugin verify-checksums --all | No |
| List plugins with updates | wp plugin list --fields=name,status,version,update_version | No |
| Deactivate one plugin | wp plugin deactivate plugin-slug | Yes |
| Run a command without loading plugins/themes | wp plugin list --skip-plugins --skip-themes | No |
| Reinstall a plugin version | wp plugin install plugin-slug --version=1.2.3 --force | Yes |
| Activate a default theme | wp theme activate twentytwentyfive | Yes |
| List administrators | wp user list --role=administrator --fields=ID,user_login,user_email,user_registered | No |
| Delete user, reassign content | wp user delete 42 --reassign=7 | Yes |
| Log out all sessions of a user | wp user session destroy username --all | Yes |
| Rotate keys and salts (logs everyone out) | wp config shuffle-salts | Yes |
| Read a wp-config constant | wp config get WP_DEBUG | No |
| Site URLs | wp option get home · wp option get siteurl | No |
| URL change (preview first) | wp search-replace 'https://old.example' 'https://new.example' --dry-run --skip-columns=guid | No (dry run) |
| Export database | wp db export backup.sql --single-transaction | No |
| Check database tables | wp db check | No |
| Database size per table | wp db size --tables --human-readable | No |
| Delete expired transients | wp transient delete --expired | Yes (safe) |
| Flush object cache | wp cache flush | Cache only |
| Regenerate rewrite rules | wp rewrite flush --hard | Yes (rules) |
| Cron: list / test / run due | wp cron event list · wp cron test · wp cron event run --due-now | Runs events |
| Maintenance mode | wp maintenance-mode status · wp maintenance-mode deactivate | Yes |
| Regenerate missing thumbnails | wp media regenerate --only-missing --yes | Yes (files) |
| Reinstall core files (keeps wp-content) | wp core download --force --skip-content | Yes (core files) |
wp-config.php constants
| Constant | Example | Purpose / caution |
|---|---|---|
WP_DEBUG | false | Enables debug mode. Production: false, except briefly while diagnosing. |
WP_DEBUG_LOG | '/home/example/logs/wp-debug.log' | Log errors; use a path outside the web root. |
WP_DEBUG_DISPLAY | false | Never display errors on production. |
SCRIPT_DEBUG | true (temporarily) | Load unminified core JS/CSS for debugging. |
WP_ENVIRONMENT_TYPE | 'production' | local, development, staging, production. |
WP_MEMORY_LIMIT / WP_MAX_MEMORY_LIMIT | '256M' / '512M' | Front-end / admin memory, up to what PHP allows. |
DISALLOW_FILE_EDIT | true | Remove theme/plugin file editors. |
DISALLOW_FILE_MODS | true | Block all installs/updates from the dashboard. Only with another update process. |
FORCE_SSL_ADMIN | true | Admin and logins over HTTPS only. |
WP_AUTO_UPDATE_CORE | 'minor' | true (all), 'minor' (default), false. |
AUTOMATIC_UPDATER_DISABLED | not set | Disables all automatic updates. Avoid. |
DISABLE_WP_CRON | true | Only with a system cron job running due events. |
WP_CACHE | true | Loads advanced-cache.php; set by caching plugins. |
WP_CACHE_KEY_SALT | 'example.com:' | Unique object-cache key prefix on shared backends (used by many object cache plugins). |
WP_POST_REVISIONS | 20 | Limit stored revisions. |
EMPTY_TRASH_DAYS | 30 | Days before trash is emptied. |
WP_HOME / WP_SITEURL | 'https://example.com' | Override the URL options (useful in recovery; hard-codes them). |
RECOVERY_MODE_EMAIL | 'ops@example.com' | Where fatal-error recovery emails go. |
WP_ALLOW_REPAIR | not set | Enables the unauthenticated DB repair page. Set only temporarily, then remove. |
ALLOW_UNFILTERED_UPLOADS | not set | Lets admins upload any file type. Do not use. |
CONCATENATE_SCRIPTS | false | Disables admin script concatenation; occasionally fixes admin JS issues behind proxies. |
FS_METHOD | 'direct' | Filesystem method for updates; only when ownership is correct. |
Paths and log locations
| What | Common location |
|---|---|
| Document root | ~/public_html/ (cPanel) · /var/www/example.com/public/ · host-specific on managed platforms |
| WordPress debug log | Path set in WP_DEBUG_LOG; default wp-content/debug.log (public, so move it) |
| PHP error log (shared hosting) | Hosting panel "Errors"/"Logs", ~/logs/, or an error_log file in the directory of the failing script |
| Apache error / access | /var/log/apache2/ (Debian/Ubuntu) · /var/log/httpd/ (RHEL family) |
| Nginx error / access | /var/log/nginx/error.log · /var/log/nginx/access.log |
| PHP-FPM | /var/log/php8.x-fpm.log (Debian/Ubuntu) · /var/log/php-fpm/ (RHEL); pool slow log as configured |
| MySQL / MariaDB | /var/log/mysql/ · /var/log/mariadb/ · or the data directory |
| WooCommerce logs | WooCommerce → Status → Logs (files in wp-content/uploads/wc-logs/ or stored in the database, per settings) |
| Nginx site config | /etc/nginx/sites-available/ · /etc/nginx/conf.d/ |
| Apache site config | /etc/apache2/sites-available/ · /etc/httpd/conf.d/ |
| PHP-FPM pools | /etc/php/8.x/fpm/pool.d/ · /etc/php-fpm.d/ |
Default permissions
Directories 755, files 644, wp-config.php 440/400/600 as the host recommends. Never 777.
Network and DNS diagnostics
curl -sI https://example.com/ # response headers (status, server, cache, security headers)
curl -sIL http://example.com/old-page/ # follow and show every redirect hop
curl -s -o /dev/null -w "%{http_code} %{time_total}s\n" https://example.com/ # status and total time
curl -sI -H "Cache-Control: no-cache" https://example.com/ # request a fresh response where honoured
curl -sI --resolve example.com:443:203.0.113.10 https://example.com/ # 203.0.113.10 = origin IP
dig +short example.com A
dig +short www.example.com CNAME
dig +short example.com MX
dig +short example.com TXT # SPF and verification records
dig +short _dmarc.example.com TXT # DMARC policy
dig +short selector._domainkey.example.com TXT # DKIM key (selector from the DKIM-Signature header)
dig +short example.com NS # authoritative nameservers
openssl s_client -connect example.com:443 -servername example.com </dev/null 2>/dev/null | openssl x509 -noout -subject -issuer -dates
HTTP status codes at a glance
| Code | Meaning | First place to look |
|---|---|---|
| 301 / 302 / 307 / 308 | Redirect (permanent / temporary) | curl -sIL, x-redirect-by header |
| 304 | Not modified (cache revalidation) | Normal |
| 400 | Bad request | Cookies, malformed URLs |
| 401 | Authentication required/failed | Basic auth, application passwords |
| 403 | Forbidden | WAF, security plugin, permissions, nonces |
| 404 | Not found | Permalinks, content, files |
| 405 | Method not allowed | Server/WAF, caching of form endpoints |
| 408 | Request timeout | Slow clients, body timeouts |
| 413 | Content too large | CDN / web server body limits |
| 429 | Too many requests | Rate limits |
| 500 | Internal server error | Server error log, PHP log, .htaccess |
| 501 | Not implemented | Unsupported method |
| 502 | Bad gateway | PHP-FPM, origin reachability |
| 503 | Service unavailable | Capacity, .maintenance, host limits |
| 504 | Gateway timeout | Slow requests, timeouts |
| 508 | Resource limit reached (CloudLinux hosts) | Entry-process limits |
Using this knowledge base
| Action | How |
|---|---|
| Search | Type in the search box at the top of the page, then ↑/↓ and Enter; Esc closes |
| Move between chapters | The chapter picker at the top of every page, or the previous and next links at the bottom |
| Open every entry in a database | Expand all in the database filter bar |
| Filter a database | Filter bar in Chapters 03, 04, 09, 13 and 19 |
| Print a chapter | Browser print; site navigation and filter bars are hidden |
| Link to a section | Use the On this page list, then copy the address bar; every section has its own anchor |
Rather have someone else keep WordPress healthy?
Our managed hosting and care plans cover updates, backups, security monitoring and fixes like the ones in this handbook, so you can get on with running the business.
See Hosting & Care