Search code examples
phpstorm

PHPStorm exclude files by mask from indexing


I'm having a PHP project that for some reason (not my initiative) has some backup files like "somefile - backup.php". How do I exclude "%backup%.php" from indexing?


Solution

  • Settings/Preferences | Editor | File Types | Ignore files and folders field on the bottom -- add *-backup.php pattern (or whatever pattern you need).

    PLEASE NOTE: this affects all projects as it is an IDE-wide setting.

    enter image description here


    Alternatively (have not tried myself, but should work):

    Settings/Preferences | Editor | File Types | Recognized File Types | Text

    Add *-backup.php pattern there.

    This will also affect all projects .. but instead of excluding it will treat them as plain text files, so no indexing/code completion/syntax highlighting/etc while still having such files in the Project View tree (so you can edit/delete/upload/etc them if necessary).