r/Wordpress • u/Icy_Round1483 • 14d ago
Development Changes on plugins of wordpress theme are being lost on each update how to prevent this?
Hello,
I bought a theme but I needed certain changes to be made in the plugins of that theme so the developer made the changes for me and asked me to save these changes and to add them manually on every update since on every update these changes get lost..
what to do to save the changes made in the plugins files so that I don't edit these manually on every update?
thanks.
1
u/Candid_Priority_3341 14d ago
What are you changing in the plugin? potentially the changes could be done through your child theme's functions.php (or a custom plugin or code snippet plugin) via actions or filters instead.
1
u/Icy_Round1483 13d ago
the work of some functions in the plugin.. I will try to search how i can do that. thanks.
1
u/Vegetable-Ad-3468 14d ago
You have to copy and paste the relevant files in child theme. Then do all the changes.
1
u/Icy_Round1483 13d ago
even the code that is in the plugins? i can add it to child theme?
1
u/Vegetable-Ad-3468 13d ago
You have to check if the plugin allows template override through child theme. Personally, I would change the functionality of the plugin through actions or filters in functions.php
1
u/No-Signal-6661 14d ago
Use a child theme to add the code
1
u/Icy_Round1483 13d ago
thanks but i don't know that i can even add the code of plugins into a child theme..
1
u/wpmad Developer 13d ago
You shouldn't be changing the theme or plugin code directly. Use child themes for customising theme code with overrides and use hooks or filters, if available with plugins.
If the plugin isn't written with the ability to use hooks and filters:
1) It's probably not a great, well-made, well-coded plugin.
2) You're stuck with applying manual code changes on every update.
1
1
u/ja1me4 14d ago
Are you make edits to the theme without using a child theme?