3

I'm trying to step up my workflow a bit and I'm now trying out Composer to handle Wordpress & Wordpress plugins.

I have never used Composer before and I'm getting quite confused as to how I'm suppose to update Wordpress with this. I know I can just type Composer update after I change the Wordpress version in my composer.json file, but that remove my wp.config.php and just reset everything.

I followed some tutorials which demonstrates how to set up Wordpress with Composer and separate the core files and the wp-content folder, for a cleaner directory structure. However, I don't understand how I can update Wordpress with Composer if I customized the folder structure, it will just reset on update.

Can someone shed some light on this?

1 Answer 1

2

Basically in “common” WordPress setup you have two things inside the folder that aren't part of the core itself: content folder and wp-config.php configuration file.

So you are on completely right path:

  1. You configure content folder to be elsewhere, outside of core folder
  2. You place wp-config.php one directory level above the core folder (WP will look for it there if it's not present in its root)

That way you have nothing in core folder left, which isn't safe to delete and overwrite with new core version.

4
  • Thanks, I did that and it's working now. However, I'm curious if I can avoid getting the wp-content folder re-generated inside the core folder each time I do a composer update? Since I set up my content folder to live outside of core, it's just useless to have the default wp-content folder be regenerated there on each update.
    – Johan Dahl
    Commented Jan 19, 2015 at 10:24
  • @JohanDahl just ignore it. :) By the way it's not completely useless since you can still register theme folder inside core and use native themes from there.
    – Rarst
    Commented Jan 19, 2015 at 10:48
  • @Rarst interesting. How does one go about doing that? Register the theme folder inside the WordPress directory along the one outside? Commented Mar 5, 2015 at 21:52
  • @Victor precisely that :)
    – Rarst
    Commented Mar 6, 2015 at 6:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.