Editing php files via ftp



I am trying to locate via the FTP login in DreamHost the file for my website that will allow me to disable comments on my WordPress site.

I can see the code that I need to delete to accomplish this in the WordPress editor under the index.php or Main index template. (My website editor is WordPress, but I’m trying to learn how to edit via FTP.) However, I cannot locate this same code anywhere in my file directories so that I can edit it via FTP.

I hope my question is clear…if not please let me know. Thank you in advance for your advice!


In this case it’s even easier than deleting the code. In your wordpress dashboard "Settings -> Discussion -> Allow people to post comments on new articles " and uncheck the box. scroll down and press save at the bottom.

To answer your question about ftp tho, when you log into FTP you will be in your home directory. Their you should see a directory named after your domain name, change into that directory by clicking it. If your wordpress install was originally in the root directory your index.php should be there. If your wordpress was originally made to a sub-directoy like wp, wordpress, blog or something else then you should see that directory in your DOMAINNAME.COM directory, change into it and you index.php should be there.

In general, the better way is to just turn off the feature, because that setting will survive upgrades. If you edit your index.php you will have to edit it again every time you upgrade your wordpress to the latest version.


To add to that, I see that the keyword in this setting is “Allow people to post comments on new articles” is New.

For old posts you can use “Bulk Edit” from the wordpress dashboard to disable the comments on old posts.