Editing Files Safely Print

  • filemanagementftp, file, errors, php, wordpress, backup, restore, htaccess, plugins, themes
  • 0

Making changes without breaking things.

THE RULE

Copy before you edit. Always.

Name the copy clearly: filename.php.backup, with today's date.

WHY

A single character error in a configuration file can take the whole site down.

WHAT TO BE ESPECIALLY CAREFUL WITH

.htaccess: a syntax error causes a 500 on every page wp-config.php: an error causes a blank page

Any PHP file: a missing bracket breaks it

AFTER EDITING

Load the site immediately and check.

Do not edit several files and then check.

IF IT BREAKS

Restore the copy. That is why you made it.

WHAT NOT TO EDIT

Core application files. Changes are lost on update and may break things.

Use the proper extension mechanism instead: a child theme, a plugin, a custom directory.

FOR LARGER CHANGES

Test on a staging copy first.

WHAT TO NEVER PASTE

Code from an unfamiliar source into a live site.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot