Save 35% on your order with code Ends in Shop now
Documentation

DooFiles

Filters and constants

For developers: the filters that change what DooFiles shows and how much it keeps, the constants of wp-config.php it respects, and the capability that decides who can open it, with examples.

Last updated: Oct 31, 2026

Overview

DooFiles can be set from the code of your site, for example to keep the same settings on every site you manage, to show only part of the server, or to lock DooFiles in read-only mode on your live site. This page lists:

  • the filters that change what DooFiles shows and how much it keeps;
  • the constants of wp-config.php that DooFiles respects;
  • the capability that decides who can open DooFiles.

Most filters replace one of the DooFiles settings, in the Security, Files and Mobile access tabs. Site owners can change those settings without code. See Settings.

Where to add the code

Add your filters in a must-use plugin, so they keep working when you change your theme and load before DooFiles:

  1. Create the folder wp-content/mu-plugins if it does not exist.
  2. Create a file inside it, for example doofiles-config.php, that starts with <?php.
  3. Add your filters below that line.
php
<?php
// Keep the activity log for 180 days.
add_filter( 'doofiles_log_days', function () {
    return 180;
} );

WordPress loads every file of that folder on its own. The functions.php file of your theme also works, but it stops working if you change your theme.

Filters and the settings page

A filter wins over the setting it replaces. As soon as you hook one, the matching row of the settings shows as locked, with the note Set by the … filter in the site's code., even if your filter returns the same value. To give the row back to the settings page, remove the filter.

Sizes go in bytes. Use the constants of WordPress to write them: 5 * MB_IN_BYTES, GB_IN_BYTES.

Where DooFiles works

FilterValueDefaultSettings row
doofiles_rootThe full path of the folder that DooFiles opens as its top folderThe folder of WordPress—

DooFiles can only open folders inside the folder of WordPress. With this filter you can narrow that down to one of its folders, for example wp-content:

php
add_filter( 'doofiles_root', function () {
    return WP_CONTENT_DIR;
} );

If the folder does not exist, or is outside the folder of WordPress, DooFiles ignores the filter and opens the whole folder of WordPress.

Private folders cannot be inside the folders of WordPress, such as wp-content. With one of those as the top folder, you cannot create private folders.

Security

FilterValueDefaultSettings row
doofiles_read_onlytrue to turn on read-only modefalseRead-only mode
doofiles_require_reauthtrue or false: ask for the password before changing codeThe setting (true)Ask for the password before changing code
doofiles_reauth_ttlSeconds that the password confirmation lasts. At least 60The setting (10 minutes)Minutes the confirmation lasts
doofiles_warn_vitaltrue or false: warn before changing what WordPress needsThe setting (true)Warn before changing WordPress files
doofiles_protect_mediatrue or false: images of the Media Library can only be saved as a copy in the viewerThe setting (true)Protect Media Library images
doofiles_vital_pathsAn array of full paths that also ask to confirm before they are moved, renamed or deleted[]—

doofiles_read_only can only turn read-only mode on. When the settings page or a constant of wp-config.php turns it on, returning false does not turn it off.

For example, to keep DooFiles in read-only mode on your live site and let it change files on your staging and local copies:

php
add_filter( 'doofiles_read_only', function () {
    return 'production' === wp_get_environment_type();
} );

WordPress treats a site as production unless WP_ENVIRONMENT_TYPE in wp-config.php says otherwise, so set it to staging or local on your other copies.

With doofiles_require_reauth set to false, saving the settings of the site, managing private folders and managing the second factor still ask for the password. See Password confirmation.

To ask for confirmation before anyone moves, renames or deletes a folder of your own, as with the files of WordPress:

php
add_filter( 'doofiles_vital_paths', function ( $paths ) {
    $paths[] = ABSPATH . 'client-files';
    return $paths;
} );

To make the confirmation last 30 minutes:

php
add_filter( 'doofiles_reauth_ttl', function () {
    return 30 * MINUTE_IN_SECONDS;
} );

Sizes and limits

FilterValueDefaultSettings row
doofiles_max_edit_sizeLargest file the editor opens, in bytesThe setting (2 MB)Largest file the editor opens
doofiles_max_upload_sizeLargest upload, in bytes. At least 1 MBThe setting (2 GB)Largest upload
doofiles_backup_max_sizeLargest file that is backed up when it is saved or replaced, in bytes50 MB—
doofiles_unzip_max_entriesMost files and folders in a zip archive that DooFiles extracts20,000—
doofiles_unzip_max_sizeMost space the extracted files of one archive can take, in bytes1 GB—

For example, to let the editor open files up to 5 MB and allow uploads up to 500 MB:

php
add_filter( 'doofiles_max_edit_size', function () {
    return 5 * MB_IN_BYTES;
} );

add_filter( 'doofiles_max_upload_size', function () {
    return 500 * MB_IN_BYTES;
} );

Very large files make the editor slow, because the browser has to load and highlight all their text. See Editor and uploads, Backups and Manage files.

Trash, backups and activity

FilterValueDefaultSettings row
doofiles_trash_daysDays that deleted items stay in the TrashThe setting (30)Days in the trash
doofiles_backup_daysDays that backups are keptThe setting (30)Days to keep backups
doofiles_backup_keepBackups kept for each file. At least 1The setting (10)Backups per file
doofiles_log_daysDays that entries of the activity log are keptThe setting (90)Days of activity
doofiles_log_maxMost entries the activity log keepsThe setting (50,000)Most activity entries

For the days, 0 keeps the items forever. For doofiles_log_max, 0 keeps every entry. Keep in mind that the Trash, the backups and the log then grow without end.

For example, to empty the Trash after 7 days:

php
add_filter( 'doofiles_trash_days', function () {
    return 7;
} );

DooFiles deletes old items once a day, and the extra backups of a file each time it gets a new one. See Trash, backups and activity.

Thumbnails

FilterValueDefaultSettings row
doofiles_thumbsWhether DooFiles makes thumbnails for the file list. With false, it makes and sends none, and deletes the ones it had in the daily cleanupThe setting (true)Make thumbnails
doofiles_thumbs_videosWhether videos get thumbnails. With false, only images doThe setting (true)Video thumbnails
doofiles_thumbs_privateWhether files in private folders get thumbnailsThe setting (true)Thumbnails in private folders
doofiles_thumbs_daysDays that an unused thumbnail is kept. At least 1The setting (30)Days to keep unused thumbnails

For example, to keep unused thumbnails one week:

php
add_filter( 'doofiles_thumbs_days', function () {
    return 7;
} );

See Thumbnails.

Languages

FilterValueDefaultSettings row
doofiles_fallback_localesAn array that says which translation a language without its own uses: each key is a language code of WordPress, complete (gl_ES) or only the language (ca), and each value is the code of a language DooFiles is translated intoRegional variants of Spanish, French, German and Portuguese use the closest translation—

See Translations, with an example.

Mobile access

FilterValueDefaultSettings row
doofiles_mobileWhether administrators can connect devices. With false, every connected device stops right awayThe setting (false)Let devices connect
doofiles_mobile_manageWhether connected devices can also create folders, rename, move, send to the Trash and restore, inside the private folders of their administrator. It only works while Mobile access is on (DooFiles 1.0.14 or newer)The setting (false)Let devices organize files
doofiles_mobile_devicesDevices each administrator can connect. 0 means no limitThe setting (5)Devices per administrator
doofiles_mobile_daysDays a device stays connected without use. 0 means neverThe setting (30)Days a device stays connected without use
doofiles_connect_originThe address of the DooFiles app. Only an https:// address is accepted; anything else is ignoredhttps://connect.doofiles.com—

For example, to let each administrator connect up to 2 devices, and disconnect them after a week without use:

php
add_filter( 'doofiles_mobile_devices', function () {
    return 2;
} );
add_filter( 'doofiles_mobile_days', function () {
    return 7;
} );

See Mobile access.

Cloudflare R2

FilterValueDefaultSettings row
doofiles_r2_step_secondsSeconds of each round when DooFiles moves, deletes or restores a large folder of a Cloudflare R2 bucket. What does not fit continues in the next round15—

Lower it if your server or a proxy cuts requests before 15 seconds. For example, for rounds of 8 seconds:

php
add_filter( 'doofiles_r2_step_seconds', function () {
    return 8;
} );

See Cloudflare R2.

Constants

Add these lines to wp-config.php, above the line that says That's all, stop editing! For examples by case, such as a live site or the rules of an agency, see Rules in wp-config.php.

ConstantWhat it doesSee
DISALLOW_FILE_EDITA constant of WordPress. DooFiles works in read-only modeRead-only mode
DISALLOW_FILE_MODSA constant of WordPress. DooFiles works in read-only modeRead-only mode
DOOFILES_DISABLE_2FATurns off the second factor of DooFiles for everyone. Only for emergencies, such as a lost phone without recovery codesSecond factor
DOOFILES_REAUTH_MINUTESMinutes that the password confirmation lasts, from 1 to 1,440 (24 hours). It wins over Minutes the confirmation lastsPassword confirmation
DOOFILES_READ_ONLYtrue keeps DooFiles in read-only mode, without locking the editors and updates of WordPress. false wins over the settingRead-only mode
DOOFILES_REQUIRE_2FAtrue requires a second factor from every administrator; false never does. It wins over Ask every administrator for a second factorSecond factor
DOOFILES_LOG_DAYSDays that the activity log is kept, from 1 to 3,650. It wins over Days of activityTrash, backups and activity
DOOFILES_MAX_UPLOAD_MBLargest upload, in MB, from 1 to 102,400. It wins over Largest uploadEditor and uploads
DOOFILES_THUMBSfalse turns off the thumbnails of the file list for the whole site. It wins over Make thumbnailsThumbnails
DOOFILES_MOBILEtrue or false turns Mobile access on or off for the whole site. It wins over Let devices connectMobile access
php
define( 'DOOFILES_READ_ONLY', true );
define( 'DOOFILES_REQUIRE_2FA', true );
define( 'DOOFILES_REAUTH_MINUTES', 240 );
define( 'DOOFILES_LOG_DAYS', 365 );
define( 'DOOFILES_MAX_UPLOAD_MB', 500 );

The settings these constants decide show as locked, with Set by … in wp-config.php., and they are the way to set a rule that nobody can change from the settings. If you also use the filter of a setting, such as doofiles_reauth_ttl, it receives the value of the constant and has the last word. DOOFILES_DISABLE_2FA wins over DOOFILES_REQUIRE_2FA, and DISALLOW_FILE_EDIT or DISALLOW_FILE_MODS turn on read-only mode even with DOOFILES_READ_ONLY set to false.

Remove DOOFILES_DISABLE_2FA as soon as you have access again.

Who can open DooFiles

DooFiles has its own capability, doofiles_manage. When you activate DooFiles, it gives that capability to the Administrator role.

To open DooFiles, a user needs both doofiles_manage and the capability to manage the options of the site (manage_options). Giving doofiles_manage to an editor does not let them in. On a multisite network, network administrators can always open DooFiles.

Keep one administrator out

To keep one administrator out of DooFiles without changing their role, deny them the capability. Run this once, with WP-CLI:

bash
wp eval "get_user_by( 'login', 'jane' )->add_cap( 'doofiles_manage', false );"

Replace jane with their username. DooFiles disappears from their menu, and they cannot open its private folders. To give it back:

bash
wp eval "get_user_by( 'login', 'jane' )->remove_cap( 'doofiles_manage' );"

A role editor plugin that can deny capabilities to a user works too.

Check whether DooFiles is active

DooFiles defines DOOFILES_VERSION with its version, for example 1.0.4. Use it to run code only when DooFiles is active:

php
if ( defined( 'DOOFILES_VERSION' ) && version_compare( DOOFILES_VERSION, '1.0.4', '>=' ) ) {
    // DooFiles 1.0.4 or newer is active.
}

DooFiles has no actions or JavaScript hooks of its own yet. If you need one, open a support ticket and tell us what for.

Troubleshooting

ProblemWhat to do
My filter does nothingCheck that the file is in wp-content/mu-plugins, not in a subfolder, and starts with <?php. The matching row of the settings page shows as locked when the filter works
A row of the settings page is locked and I did not add a filterAnother plugin or your theme hooks that filter. The note under the row says which one
doofiles_root does nothingThe folder does not exist, or is outside the folder of WordPress. Use a full path, such as WP_CONTENT_DIR
Read-only mode does not turn off with doofiles_read_onlyThe filter can only turn it on. Check the settings page and wp-config.php
An administrator cannot open DooFilesTheir role or their user lacks the doofiles_manage capability. If you denied it with add_cap, give it back with remove_cap, as shown above. Deactivating and activating DooFiles gives it back to the Administrator role

Need more help? Open a support ticket.

The product DooFiles — Secure WordPress file manager plugin The file manager WordPress should have shipped with: native, fast and secure by design. Features and pricing