• Anonymous User 18661438

    (@anonymized-18661438)


    Hi,

    I would like to have your advice on how to safely edit wp-config.php. Previously, I had tried accessing the file via FileZilla FTP and it went error while writing after editing. Therefore, I literally lost my weeks of work. Due to the unfortunate incident, I do not want to touch/alter the file again unless some experts guide me through.

    Is there any good plugin or editor to safely edit and save wp.config.php?

    Regards,
    Josh

Viewing 2 replies - 1 through 2 (of 2 total)
  • Suggest accessing your wp-config.php file using your website hosting management file manager. First download a backup copy. Then make your edits.
    DO NOT make a .bak file as a backup, it could be accessed by 3rd parties, instead name your backup something like wp-configBAK21-04-28.php
    having a .php suffix protects 3rd parties from accessing it.

    Previously, I had tried accessing the file via FileZilla FTP and it went error while writing after editing. Therefore, I literally lost my weeks of work.

    Not saying you shouldn’t take precautions, but losing your work was totally unnecessary even after losing your wp-config.php file. A new file could easily have been created to point to your existing site database, without losing any work.

    Is there any good plugin or editor to safely edit and save wp.config.php?

    No matter what tool you use, the ONLY “safe” way is to ALWAYS make a backup of important configuration files BEFORE touching it.

    I would argue the SAFEST way to edit the file is by downloading a copy to your computer via FTP (after making a backup, of course), editing the downloaded file locally with a proper text editor software on your computer, and re-uploading the edited file.

    It seems you tried to edit the file REMOTELY and directly in the FTP client, instead of downloading it to your computer first. That hardly ends well.

    An EASIER way is to use the web-based text editor provided by your host. If you have a hosting control panel like cPanel, Plesk, etc, there’s a code editor built into your “FILE MANAGER” that you can use to make such simple and quick edits. Always make a backup first, of course, no matter what tool you use.

    If you have more confidence in plugins, there are general File Manager plugins that allow you to edit files (these work similarly to the control panel option I mentioned above), such as https://ww.wp.xz.cn/plugins/file-manager-advanced/

    There are also a couple of plugins specifically for editing the wp-config.php file, such as https://ww.wp.xz.cn/plugins/wp-config-file-editor/

    Please note that I don’t have any personal experience using any of these plugins. And if I’ve not repeated myself enough, here’s one more try: no matter what tool you use to edit the file, always make a backup first so you can easily restore the original should anything go wrong!

    Good luck!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘How to edit wp-config.php file’ is closed to new replies.