By adding constants to a file wp-config.php. We can easily change the settings of the WordPress site. In this article, I have compiled a list of the most frequently used constants in WordPress
define( ‘WPLANG’, ‘ru_RU’ ); – specify localization file
define( ‘EMPTY_TRASH_DAYS’, false ); – disable trash;
define( ‘WP_POST_REVISIONS’, false ); – disable post revisions;
define( ‘DISABLE_WP_CRON’, true ); – disable cron
define( ‘AUTOSAVE_INTERVAL’, 120 ); – // increase or decrease the autosave interval;
WP_PLUGIN_DIR – gets the path to the plugins directory (for change define( ‘WP_PLUGIN_DIR ‘, ‘/new-plugins’ );
WP_PLUGIN_URL – gets the url to the plugins directory
WP_AUTO_UPDATE_CORE – Controls auto-updating of the kernel.
AUTOMATIC_UPDATER_DISABLED – Enables or disables engine auto-updates, enabled by default
CORE_UPGRADE_SKIP_NEW_BUNDLED – affect new groups of files (plugins or themes) when updating.
IMAGE_EDIT_OVERWRITE – create new or overwrite old image when editing
MEDIA_TRASH – enable or disable media trash
WP_DEFAULT_THEME – Sets the default theme for new sites
WP_CRON_LOCK_TIMEOUT – Sets the minimum time interval between cron requests.
WP_MAIL_INTERVAL – Specifies the time interval during which only one mail request can be completed.
WP_MAX_MEMORY_LIMIT – Maximum memory limit for some WordPress functions.
WP_MEMORY_LIMIT – Memory limit for executing WordPress scripts.
DOING_AJAX – Defined when executing an AJAX request (true).
DOING_AUTOSAVE – Defined when autosaving the post.
DOING_CRON – Defined if a cron job is running
REST_REQUEST – Defined when executing a REST request.
SHORTINIT – stops loading the main part of WordPress
WP_ADMIN – defined if you are in the WordPress admin panel.
WP_INSTALLING – will be determined during a new installation or upgrade.
WP_UNINSTALL_PLUGIN – Defined during plugin removal.
XMLRPC_REQUEST – defined on any XML-RPC request.
ABSPATH – the path to the WordPress root directory with a trailing slash. The path will be from the root of the server
WP_LANG_DIR – Absolute path to the directory with language files.
WP_CONTENT_DIR – absolute path to the wp-content directory.
WP_CONTENT_URL – URL to the wp-content directory.
WP_HOME – URL of your WordPress blog
WP_SITEURL – the URL of the WordPress root directory where the WordPress files are located
WP_TEMP_DIR – absolute directory path for temporary files. Typically, such files are written when updating plugins and the engine.
WPMU_PLUGIN_DIR – absolute path to the “Must Use Plugins” plugin directory.
WPMU_PLUGIN_URL – URL of plugins directory like “Must Use Plugins”
DB_CHARSET – specifies the encoding (charset) of the database
DB_COLLATE – specifies the type of comparison (collation) for the database
DB_HOST – specifies the host of the database
DB_NAME – specifies the database name
DB_PASSWORD – specifies the password for the database
DB_USER – defines a database user
WP_ALLOW_REPAIR – allows you to automatically repair and optimize database tables using /wp-admin/maint/repair.php.
CUSTOM_USER_TABLE – allows you to define your own “user” table
BACKGROUND_IMAGE – specifies the default background image.
HEADER_IMAGE – specifies the default header (header) image.
NO_HEADER_TEXT – enables or disables support for header (header) text.
STYLESHEETPATH – specifies the absolute path to the theme folder – the folder where the current stylesheet of the parent or child theme is located. Does not contain a trailing slash.
TEMPLATEPATH – specifies the absolute path from the site root to the current theme (parent, not child). Does not contain a slash at the end
FS_METHOD – specifies the file system connection method
FTP_BASE – path to WordPress root directory
SAVEQUERIES – Enables or disables writing database queries to an array ($wpdb->queries).
SCRIPT_DEBUG – Enables or disables the loading of packaged CSS and JavaScript files.
WP_DEBUG – enable or disable WordPress debug mode
WP_DEBUG_DISPLAY – enables or disables displaying errors on the screen.
WP_DEBUG_LOG – enable or disable error logging to the /wp-content/debug.log file
WP_CACHE – if specified, then WordPres will attempt to load the /wp-content/advanced-cache.php file when the page loads.
COMPRESS_CSS – enables/disables compression of stylesheets.
COMPRESS_SCRIPTS – enables/disables compression of JavaScript files.
CONCATENATE_SCRIPTS – enables/disables combining JavaScript or CSS files before compression.
ENFORCE_GZIP – enables/disables gzip compression
ADMIN_COOKIE_PATH – path to directory /wp-admin/
AUTH_COOKIE – authorization cookie name
AUTH_KEY – the secret key
COOKIE_DOMAIN – the domain that will be used in setcookie() and for which cookies will be set.
CUSTOM_TAGS – allows you to override the list of HTML security labels. Look in /wp-includes/kses.php.
DISALLOW_FILE_EDIT – allows you to disable editing of themes and plugins using the WordPress editor.
DISALLOW_UNFILTERED_HTML – allows you to disable unfiltered HTML for all users, including the admin.
MINUTE_IN_SECONDS – a minute in seconds is 60.
HOUR_IN_SECONDS – hour in seconds – 60 * MINUTE_IN_SECONDS.
DAY_IN_SECONDS – day (day) in seconds – 24 * HOUR_IN_SECONDS.