DEV Community

Discussion on: Git + WordPress

Collapse
 
drawcard profile image
Drawcard • Edited

There are two major components to WP: the site theme files (ie PHP scripts on your web server) and the database (where the actual content of your site is stored). Versioning the database is not recommended, because it is so complex and has heaps of transient data. You'd be better off taking regular snapshots of that to restore anything.

However, you can version the website files - things like the theme, plugin directory, etc. as well as critical files like wp-config.php.

Here is a good guide for a plugin based solution: kinsta.com/blog/wordpress-version-...

However if you want something simpler (say to manage a theme) you can create your own git repo privately, and then clone a bare copy of it to your web server: culttt.com/2013/04/08/how-to-deplo...

Collapse
 
bocanegradev profile image
Lukas Bocanegra

Thanks for your explanation, I'll check that info 🤘