Title: file_mod_allowed
Published: June 15, 2017
Last modified: February 24, 2026

---

# apply_filters( ‘file_mod_allowed’, bool $file_mod_allowed, string $context )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/hooks/file_mod_allowed/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/file_mod_allowed/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/file_mod_allowed/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/file_mod_allowed/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/hooks/file_mod_allowed/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/hooks/file_mod_allowed/?output_format=md#wp--skip-link--target)

Filters whether file modifications are allowed.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/file_mod_allowed/?output_format=md#parameters)󠁿

 `$file_mod_allowed`bool

Whether file modifications are allowed.

`$context`string

The usage context.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/file_mod_allowed/?output_format=md#source)󠁿

    ```php
    return apply_filters( 'file_mod_allowed', ! defined( 'DISALLOW_FILE_MODS' ) || ! DISALLOW_FILE_MODS, $context );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/load.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/load.php#L1836)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/load.php#L1836-L1836)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/file_mod_allowed/?output_format=md#related)󠁿

| Used by | Description | 
| [wp_is_file_mod_allowed()](https://developer.wordpress.org/reference/functions/wp_is_file_mod_allowed/)`wp-includes/load.php` |

Determines whether file modifications are allowed.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/file_mod_allowed/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.8.0](https://developer.wordpress.org/reference/since/4.8.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/hooks/file_mod_allowed/?output_format=md#user-contributed-notes)󠁿

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/hooks/file_mod_allowed/?output_format=md#comment-content-6464)
 2.   [Cameron Jones](https://profiles.wordpress.org/cameronjonesweb/)  [  3 years ago  ](https://developer.wordpress.org/reference/hooks/file_mod_allowed/#comment-6464)
 3. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Ffile_mod_allowed%2F%23comment-6464)
    Vote results for this note: 1[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Ffile_mod_allowed%2F%23comment-6464)
 4. When using this filter, the `capability_update_core` context is misleading, as 
    it is being passed not just when checking core files, but also when checking themes
    and plugins.
 5.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Ffile_mod_allowed%2F%3Freplytocom%3D6464%23feedback-editor-6464)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Ffile_mod_allowed%2F)
before being able to contribute a note or feedback.