PHPackages                             piotrpress/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. piotrpress/wordpress-config

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

piotrpress/wordpress-config
===========================

This library separates WordPress configuration constants from wp-config.php to .config file.

v3.0.0(3y ago)141413MITPHPPHP &gt;=7.4

Since Feb 25Pushed 3y ago1 watchersCompare

[ Source](https://github.com/PiotrPress/wordpress-config)[ Packagist](https://packagist.org/packages/piotrpress/wordpress-config)[ Docs](https://github.com/PiotrPress/wordpress-config)[ RSS](/packages/piotrpress-wordpress-config/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (5)Used By (3)

WordPress Config
================

[](#wordpress-config)

This library separates WordPress [configuration constants](https://wordpress.org/support/article/editing-wp-config-php/) from `wp-config.php` to `.config` file.

Installation via `composer.json` file
-------------------------------------

[](#installation-via-composerjson-file)

```
{
  "require": {
    "piotrpress/wordpress-config": "^3.0"
  },
  "scripts": {
    "post-update-cmd": "php -r \"copy('vendor/piotrpress/wordpress-config/res/wp-config.php', 'wp-config.php');\""
  }
}
```

**NOTE:** if `.config` file doesn't exists, it'll be created automatically.

Usage
-----

[](#usage)

Fill in the missing configuration in `.config` file.

Example
-------

[](#example)

```
DB_NAME=wordpress
DB_USER="${USER}"
DB_PASSWORD="${PASS}"
DB_HOST=localhost
WP_DEBUG=true
WP_HOME="https://${SERVER_NAME}"
WP_CONTENT_DIR="${DOCUMENT_ROOT}/wp-content"
```

**NOTE:** use `${...}` syntax to return environment or server variable.

Resources
---------

[](#resources)

Check out example implementation in the [piotrpress/wordpress](https://github.com/PiotrPress/wordpress) package.

Requirements
------------

[](#requirements)

PHP &gt;= `7.4` version.

License
-------

[](#license)

[MIT](license.txt)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 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 ~144 days

Total

4

Last Release

1110d ago

Major Versions

v1.0.0 → v2.0.02023-03-22

v2.0.1 → v3.0.02023-05-04

### 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 (4 commits)")

---

Tags

wordpressconfigurationconfigwpwp-configconfiger

### Embed Badge

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

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

###  Alternatives

[symfony/options-resolver

Provides an improved replacement for the array\_replace PHP function

3.2k493.9M1.6k](/packages/symfony-options-resolver)[roots/bedrock

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

6.5k441.8k2](/packages/roots-bedrock)[league/config

Define configuration arrays with strict schemas and access values with dot notation

564302.2M24](/packages/league-config)[wecodemore/wpstarter

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

253195.2k6](/packages/wecodemore-wpstarter)

PHPackages © 2026

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