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.

Updated · 4 min read · Level: Beginner

On this page
  1. WP-CLI commands
  2. wp-config.php constants
  3. Paths and log locations
  4. Network and DNS diagnostics
  5. HTTP status codes at a glance
  6. Using this knowledge base

WP-CLI commands

TaskCommandChanges data?
Environment summarywp --infoNo
Core version / updates availablewp core version --extra · wp core check-updateNo
Verify core fileswp core verify-checksumsNo
Verify plugin files (WordPress.org plugins)wp plugin verify-checksums --allNo
List plugins with updateswp plugin list --fields=name,status,version,update_versionNo
Deactivate one pluginwp plugin deactivate plugin-slugYes
Run a command without loading plugins/themeswp plugin list --skip-plugins --skip-themesNo
Reinstall a plugin versionwp plugin install plugin-slug --version=1.2.3 --forceYes
Activate a default themewp theme activate twentytwentyfiveYes
List administratorswp user list --role=administrator --fields=ID,user_login,user_email,user_registeredNo
Delete user, reassign contentwp user delete 42 --reassign=7Yes
Log out all sessions of a userwp user session destroy username --allYes
Rotate keys and salts (logs everyone out)wp config shuffle-saltsYes
Read a wp-config constantwp config get WP_DEBUGNo
Site URLswp option get home · wp option get siteurlNo
URL change (preview first)wp search-replace 'https://old.example' 'https://new.example' --dry-run --skip-columns=guidNo (dry run)
Export databasewp db export backup.sql --single-transactionNo
Check database tableswp db checkNo
Database size per tablewp db size --tables --human-readableNo
Delete expired transientswp transient delete --expiredYes (safe)
Flush object cachewp cache flushCache only
Regenerate rewrite ruleswp rewrite flush --hardYes (rules)
Cron: list / test / run duewp cron event list · wp cron test · wp cron event run --due-nowRuns events
Maintenance modewp maintenance-mode status · wp maintenance-mode deactivateYes
Regenerate missing thumbnailswp media regenerate --only-missing --yesYes (files)
Reinstall core files (keeps wp-content)wp core download --force --skip-contentYes (core files)

wp-config.php constants

ConstantExamplePurpose / caution
WP_DEBUGfalseEnables 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_DISPLAYfalseNever display errors on production.
SCRIPT_DEBUGtrue (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_EDITtrueRemove theme/plugin file editors.
DISALLOW_FILE_MODStrueBlock all installs/updates from the dashboard. Only with another update process.
FORCE_SSL_ADMINtrueAdmin and logins over HTTPS only.
WP_AUTO_UPDATE_CORE'minor'true (all), 'minor' (default), false.
AUTOMATIC_UPDATER_DISABLEDnot setDisables all automatic updates. Avoid.
DISABLE_WP_CRONtrueOnly with a system cron job running due events.
WP_CACHEtrueLoads 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_REVISIONS20Limit stored revisions.
EMPTY_TRASH_DAYS30Days before trash is emptied.
WP_HOME / WP_SITEURL'https://example.com'Override the URL options (useful in recovery; hard-codes them).
RECOVERY_MODE_EMAIL'[email protected]'Where fatal-error recovery emails go.
WP_ALLOW_REPAIRnot setEnables the unauthenticated DB repair page. Set only temporarily, then remove.
ALLOW_UNFILTERED_UPLOADSnot setLets admins upload any file type. Do not use.
CONCATENATE_SCRIPTSfalseDisables 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

WhatCommon location
Document root~/public_html/ (cPanel) · /var/www/example.com/public/ · host-specific on managed platforms
WordPress debug logPath 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 logsWooCommerce → 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

CodeMeaningFirst place to look
301 / 302 / 307 / 308Redirect (permanent / temporary)curl -sIL, x-redirect-by header
304Not modified (cache revalidation)Normal
400Bad requestCookies, malformed URLs
401Authentication required/failedBasic auth, application passwords
403ForbiddenWAF, security plugin, permissions, nonces
404Not foundPermalinks, content, files
405Method not allowedServer/WAF, caching of form endpoints
408Request timeoutSlow clients, body timeouts
413Content too largeCDN / web server body limits
429Too many requestsRate limits
500Internal server errorServer error log, PHP log, .htaccess
501Not implementedUnsupported method
502Bad gatewayPHP-FPM, origin reachability
503Service unavailableCapacity, .maintenance, host limits
504Gateway timeoutSlow requests, timeouts
508Resource limit reached (CloudLinux hosts)Entry-process limits

Using this knowledge base

ActionHow
SearchType in the search box at the top of the page, then ↑/↓ and Enter; Esc closes
Move between chaptersThe chapter picker at the top of every page, or the previous and next links at the bottom
Open every entry in a databaseExpand all in the database filter bar
Filter a databaseFilter bar in Chapters 03, 04, 09, 13 and 19
Print a chapterBrowser print; site navigation and filter bars are hidden
Link to a sectionUse 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