Home › Forums › BulletProof Security Pro › How to edit wp-config properly?
- This topic has 8 replies, 2 voices, and was last updated 2 years, 9 months ago by
Laurent.
-
AuthorPosts
-
Laurent
ParticipantHi Edward,
I’d like to add a code snippet insode the wp-config.php file to disable post revisions.
To do that, I assume I need to do it using BPS Pro rather than trying to do it via my hosting acount.
I came accross a post dating back to 2017 where you said to go to P-Security > File Manager.
So I did that but I can’t see clearly where I can select the wp-config file.
Also, does BPS allow to decide where I want to put my code snippet within the wp-config.php file?
Thank you.
AITpro Admin
KeymasterYou can either use FTP or your web host control panel file manager or the BPS Pro File Manager and File Editor tools to edit your wp-config.php file. See the AutoRestore|Quarantine Standard Procedural Steps when manually modifying files help info here > http://forum.ait-pro.com/forums/topic/autorestore-quarantine-guide-read-me-first/#procedural-steps
Laurent
ParticipantI tried to do it inside BPS Pro but can’t select the wp-config.php file in the dropdown of the File Editor as it is empty.
So I thought “Maybe I shuold unlock the file using the F-Lock feature, which I did and went back to the File Editor and File Manager but I still don’t see what to do.
Here is my File Editor and my F-Lock (wp-config is not visible but it is CGI unlocked).
AITpro Admin
KeymasterDid you create a label/name for the wp-config.php file that you added in the File Manager? Is the path to your wp-config.php file correct in the File Manager?
Laurent
ParticipantThanks for your comment. It helped me understand what I had to do to make it work.
So I created a label wp-config.php and filled in the folder path in the File Manager.
Then I went to the File Editor tab, selected my file, made the change and clicked on ‘Save changes’.
Next, I logged in to my hosting account (cPanel) to make sure my instructions had been added. And good news: they were … UNTIL BPS Pro quarantined the file.
After reading your comment, I thought it would only happen if I did it manually OUTSIDE WordPress. Did I get it wrong?
Also, I realize that if I make changes using BPS Pro rather than manually in my hosting account, it adds risk if someone can access my WP admin account (as they will be able to display the wp-config. from the BPS interface and see what’s inside).
If you agree with my conclusions, then maybe I should not use BPS for that.
And finally, if I want to make changes to the functions.php file, does it work the same way?
I’d like to remove the default compression applied by WP to uploaded images.
Thank you Edward!
AITpro Admin
KeymasterThe BPS Pro File Editor intentionally does not copy a backup copy of edited files to the AutoRestore backup folder. So yep the correct step to do after editing a file is to restore that edited file from Quarantine after it is autorestored and quarantined by AutoRestore|Quarantine.
If someone (a hacker, etc.) with Administrator permissions logs into your website then the least of your worries would be displaying the wp-config.php file in the BPS Pro File Manager and File Editor tools. If a hacker or someone else that you allow has Administrator permissions to the backend of your site they can do anything that you can do in the backend of your site.
Laurent
ParticipantGot it. Once I’ve restored it, should I keep the label in the File Manager or can I remove it?
And finally, if I want to make changes to the functions.php file, does it work the same way (File Manager, then File Editor) ? I’d like to remove the default compression applied by WP to uploaded images.
Thank you.
AITpro Admin
KeymasterKeeping or removing the files saved in the File Manager is up to you. I keep several files that I edit from time to time in the File Manager so I don’t have to re-add them. Any/all files that you add to the File Manager is the same exact process. Create a label/name (displayed in the File Editor drop down list Form) and add the path to the file you want to edit.
Laurent
ParticipantGot it. Thank you!
I wanted to make sure that if I remove a file from the File Manager, it doesn’t somehow remove the modifications I made in the file.
Bless you!
-
AuthorPosts
- You must be logged in to reply to this topic.