Plugin File From Being Overwritten?

158 Views Asked by At

How can I keep a plugin from overwriting a file that has been customized? Can something be added to the functions.php file?

1

There are 1 best solutions below

0
On

The simple answer is you don't. Modifying plugins or themes prevents you from updating the plugin/theme in the future - by design, your changes would be lost. You can theoretically change the filesystem permissions for the plugin directory (not just the file you modified - you have to freeze the whole plugin/theme at that point or risk fatal errors), but that's bad practice - updates happen for a reason! The better question is why did you need to modify the plugin? More often than not, plugins give you the opportunity to modify their behavior or otherwise extend them (even if they aren't well documented as such). If you can give us a better idea of what the underlying need is, there's a fairly high chance someone can give you a non-destructive solution.