Skip to content

Custom Project Structure

Some advanced users like having WordPress in its own directory or move plugins, themes or uploads in another directory. VersionPress supports some scenarios. Just remember that all files related to the site have to be under the project root (VP_PROJECT_ROOT).

Warning

You need to adjust your project structure before fully initializing VersionPress. The recommended procedure is:

  • Customize your WordPress site structure.
  • Install and active VersionPress, the plugin – do not go through the full initialization yet.
  • Follow the instructions below, i.e., set some config constant like VP_PROJECT_ROOT.
  • Initialize VersionPress.

Giving WordPress its own directory

You can move WordPress into its own directory by following instructions on Codex. However, there is one extra step. You need to define VP_PROJECT_ROOT constant to let VersionPress know where it should create the repository. See the configuration page for instructions.

.git directory

Be sure that the .git directory stays in the root directory if the project is already versioned.

Moving wp-content, plugin or uploads directories

It is possible to move these folders by following instructions on Codex. Be sure that you define constants referencing directories in the wp-config.common.php and constants containing URLs in the wp-config.php if VersionPress is already active.

Moving VPDB directory

You can also rename or move the directory where VersionPress saves all its data. Use constant VP_VPDB_DIR to get it done. See the configuration page for instructions.

Note

It will NOT be possible to undo changes before moving the directory.