PHPackages                             clearcode/wordpress-config - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. clearcode/wordpress-config

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

clearcode/wordpress-config
==========================

Automagically define WordPress configuration constants from environment variables and .env file.

v1.0.13(5y ago)03201GPL-3.0+PHPPHP &gt;=7.2

Since Oct 10Pushed 5y ago2 watchersCompare

[ Source](https://github.com/ClearcodeHQ/wordpress-config)[ Packagist](https://packagist.org/packages/clearcode/wordpress-config)[ Docs](https://clearcode.cc)[ RSS](/packages/clearcode-wordpress-config/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (1)Versions (15)Used By (1)

Clearcode WordPress Config
==========================

[](#clearcode-wordpress-config)

Automagically define WordPress [configuration constants](https://codex.wordpress.org/Editing_wp-config.php) from [environment variables](http://php.net/manual/en/reserved.variables.environment.php) and `.env` file.

Installation
============

[](#installation)

```
$ composer require clearcode/wordpress-config
```

Usage
=====

[](#usage)

Copy `wp-config.php` file to WordPress' root directory.

Create `.env` file and fill in the missing content:

```
DB_NAME=''
DB_USER=''
DB_PASSWORD=''
DB_HOST='localhost'
DB_CHARSET='utf8mb4'
DB_COLLATE=''
DB_PREFIX='wp_'

AUTH_KEY=''
SECURE_AUTH_KEY=''
LOGGED_IN_KEY=''
NONCE_KEY=''
AUTH_SALT=''
SECURE_AUTH_SALT=''
LOGGED_IN_SALT=''
NONCE_SALT=''

WP_VARS=''
```

You can also use environment variables that you have set in your `.env` file via a command line script, by using `source` it into your local shell session:

```
$ source .env
```

Instead of `.env` file you can use environment variables e.g. defined in you Apache server vhost configuration file:

```

...
	SetEnv DB_NAME ''
	SetEnv DB_USER ''
	SetEnv DB_PASSWORD ''
	SetEnv DB_HOST 'localhost'
	SetEnv DB_CHARSET 'utf8mb4'
	SetEnv DB_COLLATE ''
	SetEnv DB_PREFIX 'wp_'

	SetEnv AUTH_KEY ''
	SetEnv SECURE_AUTH_KEY ''
	SetEnv LOGGED_IN_KEY ''
	SetEnv NONCE_KEY ''
	SetEnv AUTH_SALT ''
	SetEnv SECURE_AUTH_SALT ''
	SetEnv LOGGED_IN_SALT ''
	SetEnv NONCE_SALT ''

	SetEnv WP_VARS ''
...

```

You can use all WordPress configuration constants, optionally you can add your own variables, but if you want to convert them from environment variables to PHP constants, you need to add them to `WP_VARS` environment variable, separated by coma.

License
=======

[](#license)

GPL3.0+ see [LICENSE.txt](LICENSE.txt) and [AUTHORS.txt](AUTHORS.txt)

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~61 days

Recently: every ~127 days

Total

14

Last Release

2023d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10326736?v=4)[Piotr Niewiadomski](/maintainers/PiotrPress)[@PiotrPress](https://github.com/PiotrPress)

---

Top Contributors

[![PiotrPress](https://avatars.githubusercontent.com/u/10326736?v=4)](https://github.com/PiotrPress "PiotrPress (11 commits)")

---

Tags

composerwordpressconfigurationconfigenvironmentenvdotenvcmswpblogwp-config

### Embed Badge

![Health badge](/badges/clearcode-wordpress-config/health.svg)

```
[![Health](https://phpackages.com/badges/clearcode-wordpress-config/health.svg)](https://phpackages.com/packages/clearcode-wordpress-config)
```

###  Alternatives

[roots/bedrock

WordPress boilerplate with Composer, easier configuration, and an improved folder structure

6.5k463.8k2](/packages/roots-bedrock)[ffraenz/private-composer-installer

A composer install helper for private packages

2321.7M5](/packages/ffraenz-private-composer-installer)[philippbaschke/acf-pro-installer

An install helper for Advanced Custom Fields PRO

278724.6k](/packages/philippbaschke-acf-pro-installer)[wecodemore/wpstarter

Composer plugin to easily build WordPress websites entirely managed via Composer.

254208.3k9](/packages/wecodemore-wpstarter)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
