[Skip to content](#main)

[→](/)

[![Avunu](/brand/avunu-logo.svg)![Avunu](/brand/avunu-logo-light.svg)](/)[Services](/services/)[Consulting](/services/consulting/)[ERP](/services/erp/)[Odoo](/services/erp/odoo/)[ERPNext](/services/erp/erpnext/)[Custom software](/services/custom-software/)[Devices & IoT](/services/devices-iot/)[Websites](/services/websites/)[Infrastructure](/services/infrastructure/)[Partners](/partners/)

[Work](/work/)[Open source](/open-source/)[Knowledge base](/kb/)[About](/about/)

[About Avunu](/about/)[Team](/about/team/)[Insights](/insights/)[Contact](/contact/)

[Client portal](https://erp.avunu.net/projects)[Start a project](/start/)

- [Services](/services/)[Consulting](/services/consulting/)
- [ERP](/services/erp/)
- [Odoo](/services/erp/odoo/)
- [ERPNext](/services/erp/erpnext/)
- [Custom software](/services/custom-software/)
- [Devices & IoT](/services/devices-iot/)
- [Websites](/services/websites/)
- [Infrastructure](/services/infrastructure/)
- [Partners](/partners/)

[Work](/work/)[Open source](/open-source/)[Knowledge base](/kb/)[About](/about/)

- [About Avunu](/about/)
- [Team](/about/team/)
- [Insights](/insights/)
- [Contact](/contact/)

[Client portal](https://erp.avunu.net/projects)[Start a project](/start/)

[Knowledge base](/kb/)[WordPress](/kb/wordpress/)wp-config.php reference

Search the knowledge basePress/

ESC

Jump to

[Browse the knowledge base](/kb/)[Frappe](/kb/frappe/)[ERPNext](/kb/erpnext/)[Odoo](/kb/odoo/)[WordPress](/kb/wordpress/)[NixOS](/kb/nixos/)[Email](/kb/email/)[Linux](/kb/linux/)[Databases](/kb/databases/)[Containers](/kb/containers/)[Proxmox](/kb/proxmox/)[Git & Dev Tools](/kb/git-and-dev-tools/)

↵select↑↓navigateescclose

Search the knowledge base

[Skip to the article](#kb-article)[WordPress](/kb/wordpress/)10 articles

- [Overview](/kb/wordpress/)
- [Admin-only custom post types with custom list columns](/kb/wordpress/custom-post-type-admin/)
- [Docket Cache baseline configuration](/kb/wordpress/docket-cache-configuration/)
- [Gravity Forms](/kb/wordpress/gravity-forms/)
- [Populate Gravity Forms image choices from an ACF image field](/kb/wordpress/gravity-forms-image-choices-acf/)
- [Register custom block styles in a classic theme](/kb/wordpress/block-styles-classic-themes/)
- [Run WordPress cron from the system scheduler](/kb/wordpress/wordpress-cron/)
- [Split a child theme's functions.php into included files](/kb/wordpress/child-theme-file-includes/)
- [WordPress database optimization queries](/kb/wordpress/database-optimization-queries/)
- [WordPress debugging snippets](/kb/wordpress/debugging-snippets/)
- [WP-CLI cookbook](/kb/wordpress/wp-cli-cookbook/)
- [wp-config.php reference](/kb/wordpress/wp-config-reference/)

Other sections[Frappe](/kb/frappe/)[ERPNext](/kb/erpnext/)[Odoo](/kb/odoo/)[NixOS](/kb/nixos/)[Email](/kb/email/)[Linux](/kb/linux/)[Databases](/kb/databases/)[Containers](/kb/containers/)[Proxmox](/kb/proxmox/)[Git & Dev Tools](/kb/git-and-dev-tools/)

In WordPress: 10 articles

[Overview](/kb/wordpress/)[Admin-only custom post types with custom list columns](/kb/wordpress/custom-post-type-admin/)[Docket Cache baseline configuration](/kb/wordpress/docket-cache-configuration/)[Gravity Forms](/kb/wordpress/gravity-forms/)[Populate Gravity Forms image choices from an ACF image field](/kb/wordpress/gravity-forms-image-choices-acf/)[Register custom block styles in a classic theme](/kb/wordpress/block-styles-classic-themes/)[Run WordPress cron from the system scheduler](/kb/wordpress/wordpress-cron/)[Split a child theme's functions.php into included files](/kb/wordpress/child-theme-file-includes/)[WordPress database optimization queries](/kb/wordpress/database-optimization-queries/)[WordPress debugging snippets](/kb/wordpress/debugging-snippets/)[WP-CLI cookbook](/kb/wordpress/wp-cli-cookbook/)[wp-config.php reference](/kb/wordpress/wp-config-reference/)

Other sections[Frappe](/kb/frappe/)[ERPNext](/kb/erpnext/)[Odoo](/kb/odoo/)[NixOS](/kb/nixos/)[Email](/kb/email/)[Linux](/kb/linux/)[Databases](/kb/databases/)[Containers](/kb/containers/)[Proxmox](/kb/proxmox/)[Git & Dev Tools](/kb/git-and-dev-tools/)

WordPresswp-config.php reference

The wp-config.php constants Avunu sets most often for cron, memory limits, debugging, and Redis object caching, with what each one does.

UpdatedOct 1, 2026

Applies toWordPress 6.xRedis Object Cache 2.x

Tagswordpresswp-configcachingredis

Reading time3 min

On this page[Cron](#cron)[Memory Limits](#memory-limits)[Debugging](#debugging)[Redis Object Cache](#redis-object-cache)[Unix Socket (Same Server)](#unix-socket-same-server)[TCP (Local or Remote)](#tcp-local-or-remote)[Always Set a Prefix](#always-set-a-prefix)

This is a quick reference for the `wp-config.php` constants Avunu sets on most sites. Add constants above the `/* That's all, stop editing! */` line. Anything defined after it is too late for WordPress to read.

You can set any of them from the WordPress directory with `wp config set <NAME> <VALUE>`. Add `--raw` for booleans and numbers so they aren't written as strings.

## Cron

```
<span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">define</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">( </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'DISABLE_WP_CRON'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">, </span><span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">true</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> );</span>
```

Stops WordPress from running scheduled tasks during page loads. Only set this together with a server cron job, as described in [WordPress Cron](/kb/wordpress/wordpress-cron/), or scheduled tasks stop running.

## Memory Limits

```
<span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">define</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">( </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'WP_MEMORY_LIMIT'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">, </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'256M'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> );     </span><span style="--shiki-dark:#8B949E;--shiki-light:#6E7781">// Front end. WordPress default: 40M (64M on multisite).</span>
<span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">define</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">( </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'WP_MAX_MEMORY_LIMIT'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">, </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'512M'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> ); </span><span style="--shiki-dark:#8B949E;--shiki-light:#6E7781">// wp-admin and other memory-hungry tasks. Default: 256M.</span>
```

WordPress raises PHP's `memory_limit` to these values when it's lower. They can't exceed a hard limit set by the host, so if the value doesn't take effect, raise `memory_limit` in the PHP-FPM pool or `php.ini` instead. Check what WordPress sees under Tools > Site Health > Info > Server.

WooCommerce and page builders usually need at least `256M`.

## Debugging

```
<span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">define</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">( </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'WP_DEBUG'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">, </span><span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">true</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> );</span>
<span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">define</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">( </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'WP_DEBUG_LOG'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">, </span><span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">true</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> );</span>
<span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">define</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">( </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'WP_DEBUG_DISPLAY'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">, </span><span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">false</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> );</span>
```

See [Debugging Snippets](/kb/wordpress/debugging-snippets/) for the full set, safe log locations, and the WP-CLI equivalents.

## Redis Object Cache

These constants configure the [Redis Object Cache](https://wordpress.org/plugins/redis-cache/) plugin. Define them before enabling the drop-in with `wp redis enable`.

### Unix Socket (Same Server)

A Unix socket is faster than TCP when Redis runs on the same machine. Set the scheme and socket path. `WP_REDIS_HOST` and `WP_REDIS_PORT` aren't used for sockets.

```
<span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">define</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">( </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'WP_REDIS_SCHEME'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">, </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'unix'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> );</span>
<span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">define</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">( </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'WP_REDIS_PATH'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">, </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'/run/redis/redis.sock'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> );</span>
<span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">define</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">( </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'WP_REDIS_PREFIX'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">, </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'example_com:'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> );</span>
```

The socket path depends on the distribution and Redis config (`unixsocket` in `redis.conf`). Common locations are `/run/redis/redis.sock` and `/var/run/redis/redis.sock`. The PHP user needs permission to read and write the socket, usually by being in the `redis` group.

### TCP (Local or Remote)

```
<span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">define</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">( </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'WP_REDIS_HOST'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">, </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'127.0.0.1'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> );</span>
<span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">define</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">( </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'WP_REDIS_PORT'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">, </span><span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">6379</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> );</span>
<span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">define</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">( </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'WP_REDIS_DATABASE'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">, </span><span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">0</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> );</span>
<span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">define</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">( </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'WP_REDIS_PREFIX'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">, </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">'example_com:'</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> );</span>
```

For a remote Redis server, use a private network address (for example in `10.0.0.0/24`), require a password with `WP_REDIS_PASSWORD`, and never expose port 6379 to the internet.

### Always Set a Prefix

Warning

When several sites share one Redis server, give each a unique, readable `WP_REDIS_PREFIX`. Without it, sites read each other's cached options and users. A cache flush empties the whole Redis database, so also give each site its own `WP_REDIS_DATABASE` (0–15) where possible. `WP_REDIS_SELECTIVE_FLUSH` limits flushes to the prefix instead, but it's much slower.

Note

Some hosting panels ship their own Redis cache plugin with a different constant prefix. Check the host's documentation rather than mixing two plugins' constants. Only one object cache drop-in can be active, so pick Redis Object Cache, the host's plugin, or [Docket Cache](/kb/wordpress/docket-cache-configuration/), not several.

Check the connection after configuring:

```
<span style="--shiki-dark:#FFA657;--shiki-light:#953800">wp</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">redis</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">status</span>
```

Sources

- [developer.wordpress.org/advanced-administration/wordpress/wp-config](https://developer.wordpress.org/advanced-administration/wordpress/wp-config/)
- [github.com/rhubarbgroup/redis-cache](https://github.com/rhubarbgroup/redis-cache)
- [developer.wordpress.org/cli/commands/config](https://developer.wordpress.org/cli/commands/config/)

Need help with WordPress?

Our notes can take you a long way, but sometimes you'd rather have someone who's done it before.

[Websites](/services/websites/)

[← PreviousWP-CLI cookbook](/kb/wordpress/wp-cli-cookbook/)

CC0This article is in the public domain ([CC0 1.0](https://creativecommons.org/publicdomain/zero/1.0/)), code samples included. Use it however helps you.

On this page

- [Cron](#cron)
- [Memory Limits](#memory-limits)
- [Debugging](#debugging)
- [Redis Object Cache](#redis-object-cache)
- [Unix Socket (Same Server)](#unix-socket-same-server)
- [TCP (Local or Remote)](#tcp-local-or-remote)
- [Always Set a Prefix](#always-set-a-prefix)

[Back to top↑](#top)

Services

- [ERP implementation](/services/erp/)
- [Odoo](/services/erp/odoo/)
- [ERPNext](/services/erp/erpnext/)
- [Custom software](/services/custom-software/)
- [Devices & IoT](/services/devices-iot/)
- [Websites](/services/websites/)
- [Infrastructure](/services/infrastructure/)

Resources

- [Our work](/work/)
- [Open source](/open-source/)
- [Knowledge base](/kb/)
- [Insights](/insights/)

Company

- [About](/about/)
- [Team](/about/team/)
- [Partners](/partners/)
- [Contact](/contact/)

Clients

- [Project portal](https://erp.avunu.net/projects)
- [Invoices](https://erp.avunu.net/)
- [Support](https://erp.avunu.net/)

[![Avunu](/brand/avunu-logo-light.svg)](/)[\<av-icon data-jx-static>\<svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor" stroke="none" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">\<path d="M20.400 20.500h-3.600v-5.600c0-1.300 0-3-1.800-3s-2.100 1.400-2.100 2.900v5.700H9.400V9h3.400v1.600c.5-.9 1.600-1.900 3.400-1.900 3.600 0 4.300 2.400 4.300 5.500v6.300zM5.300 7.400a2.100 2.100 0 1 1 0-4.100 2.100 2.100 0 0 1 0 4.100zm1.800 13.100H3.600V9h3.500v11.500zM22.200 0H1.800C.8 0 0 .8 0 1.700v20.600c0 .9.800 1.700 1.800 1.700h20.400c1 0 1.800-.8 1.800-1.700V1.700C24 .8 23.200 0 22.200 0z">\</path>\</svg>\</av-icon>](https://www.linkedin.com/company/avunu)[\<av-icon data-jx-static>\<svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor" stroke="none" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">\<path d="M12 .3a12 12 0 0 0-3.8 23.4c.6.1.8-.3.8-.6v-2c-3.3.7-4-1.6-4-1.6-.6-1.4-1.4-1.8-1.4-1.8-1-.7.1-.7.1-.7 1.2.1 1.8 1.2 1.8 1.2 1 1.8 2.8 1.3 3.5 1 .1-.8.4-1.3.7-1.6-2.7-.3-5.5-1.3-5.5-5.9 0-1.3.5-2.4 1.2-3.2-.1-.3-.5-1.5.1-3.2 0 0 1-.3 3.3 1.2a11.500 11.500 0 0 1 6 0c2.300-1.500 3.300-1.200 3.300-1.200.6 1.700.2 2.900.1 3.200.8.8 1.200 1.900 1.200 3.200 0 4.600-2.800 5.600-5.500 5.900.4.400.8 1.100.8 2.200v3.300c0 .3.2.7.8.6A12 12 0 0 0 12 .3">\</path>\</svg>\</av-icon>](https://github.com/Avunu)[Client portal](https://erp.avunu.net/projects)[Start a project](/start/)

Avunu LLC · 948 East Philadelphia Street, York, PA 17403 · (717) 814-8540Knowledge base articles are in the public domain[Privacy](/privacy/)[Terms](/terms/)
