Title: Install PHPCS at the project level
Author: WordPress VIP Documentation
Published: September 4, 2023
Last modified: December 29, 2025

---

 1. [PHPCS for WordPress VIP](https://docs.wpvip.com/php_codesniffer/)
 2. Install PHPCS at the project level

#  Install PHPCS at the project level

Installing PHPCS at the project level limits the availability of PHPCS to only from
within that project directory. Following these instructions will install:

 * The latest compatible version of PHPCS
 * The latest release of [VIP-Coding-Standards (VIPCS)](https://github.com/Automattic/VIP-Coding-Standards/releases)
 * A compatible version of the [WordPress Coding Standards](https://github.com/WordPress/WordPress-Coding-Standards)(
   WordPressCS)
 * Compatible versions of other standards packages, like VariableAnalysis, PHPCSUtils
   and PHPCSExtra

**Note**

PHPCS commands on a local machine running [Windows may require different formatting](https://www.php.net/manual/en/install.windows.commandline.php)
than the command examples shown below.

## Install

In the local machine’s terminal:

 1. Before beginning installation, ensure that Composer itself is up to date:

    ```wp-block-preformatted
    composer self-update && composer global update
    ```

 2. Navigate (`cd`) to the root of the project.
 3.  Run the following command to add or update `composer.json` and `composer.lock`
    files and a `vendor/` directory (the `vendor/` directory can optionally be ignored
    in version control):

    ```wp-block-preformatted
    composer require --dev automattic/vipwpcs
    ```

## Command formatting

When PHPCS is installed locally (at the project level), it will be necessary to 
format the commands shown below directly referencing the executable at `vendor/bin/
phpcs` instead of `phpcs`.

For example, this command:

    ```wp-block-preformatted
    phpcs -i
    ```

should instead be formatted as:

    ```wp-block-preformatted
    vendor/bin/phpcs -i
    ```

Last updated: December 29, 2025