<p>Easiest way is to have separate branches for the Craft 3 and Craft 4 version of the plugin. Then also increment the major version number of the Craft 4 version, and tag each release separately.</p>

CC BY-SA 4.0
2022-08-26T08:41:29.457Z
Will craft "understand" which branch is for Craft 3 and 4 when installing plugin?
Piotr Pogorzelski
CC BY-SA 4.0
2022-08-26T15:26:10.393Z
Each branch will have a separate `composer.json` file with different version requirements, so yes. This is how I do it for all of my plugins. Look at the branches here, for example: https://github.com/nystudio107/craft-retour
andrew.welch
CC BY-SA 4.0
2022-08-26T00:55:27.363Z
2022-08-26T00:55:27.363Z
andrew.welch
<p>I have a plugin that initially was created for version 3.x of Craft, but was updated to be compatible with Craft 4. How can I update the plugin with some new features for Craft 3?</p>

CC BY-SA 4.0
2022-08-18T23:23:13.610Z
Did you look at https://craftcms.com/docs/4.x/extend/updating-plugins.html#high-level-notes yet?
Mark Busnelli Jr
CC BY-SA 4.0
2022-08-19T14:12:43.533Z
Is this your own plugin? Or do you mean, that the plugin was made compatible for Craft 4 and new features are now added to the v4 compatible version but not being backported or provided in a separate v3 branch?
Matthias Redl-Mann
<plugin-development>
How to update Craft 3 version of plugin when Craft 4 version is already released?
# How to update Craft 3 version of plugin when Craft 4 version is already released?

(Asked by: username_0 on 2022-08-18)

I have a plugin that initially was created for version 3.x of Craft, but was updated to be compatible with Craft 4. How can I update the plugin with some new features for Craft 3?

**Tags:** plugin-development
> **Comments:**
> **username_1**: Did you look at https://craftcms.com/docs/4.x/extend/updating-plugins.html#high-level-notes yet?  
> **username_2**: Is this your own plugin? Or do you mean, that the plugin was made compatible for Craft 4 and new features are now added to the v4 compatible version but not being backported or provided in a separate v3 branch?  

---

## 1 answers

### Answer by username_3 on 2022-08-26. Score: 1 | Accepted answer

Easiest way is to have separate branches for the Craft 3 and Craft 4 version of the plugin. Then also increment the major version number of the Craft 4 version, and tag each release separately.

> **Comments:**
> **username_0**: Will craft "understand" which branch is for Craft 3 and 4 when installing plugin?  
> **username_3**: Each branch will have a separate `composer.json` file with different version requirements, so yes. This is how I do it for all of my plugins. Look at the branches here, for example: https://github.com/nystudio107/craft-retour  

---

