Random File
This plugin provides template tags that allow you to retrieve the name, path (relative or absolute), url, or fully marked-up link to a randomly chosen file or files in a specified directory.
Envisager une alternative
Random File shows warning signs in 2026 — compare the alternatives below before installing. It runs on 70+ sites, is rated 5/5 and was last updated 2 years ago, and scores 41/100 on our health check.
- Petite base d'utilisateurs (plus de 70 installations actives)
- Très peu de critiques jusqu'à présent
- Pas de mise à jour depuis plus d'un an
- Uniquement testé jusqu'à WordPress 6,8 (le dernier est de 7,1)
Comment s'accumule-t-il ?
Côte à côte sur les installations, les mises à jour, les évaluations et le supportTéléchargements quotidiens
Les pics de téléchargement suivent généralement une nouvelle version - chaque site qui met à jour automatiquement compte comme un téléchargement.
Classements
Where Random File stands todayWordPress.org Classements de recherche
Position en direct dans la recherche de plugins, Top 100| Mot-clé | Position |
|---|---|
| coffee2code | #9 |
| file | >100 |
| fichiers | >100 |
| fait au hasard | #48 |
| randomize | #32 |
Adoption de version
Part de sites actifs par version.
Répartition des notes
★★★★★ ★★★★★ 5 sur 1 avis
About Random File
À partir du Lisez-moi officiel · v2.0.1Description
This plugin provides template tags that allow you to retrieve the name, path (relative or absolute), url, or fully marked-up link to a randomly chosen file or files in a specified directory.
Arguments to the functions permit you to limit what file(s) can be randomly selected based on a given set of file extensions. You can also explicitly specify files that should not be randomly selected.
This functionality can be useful for displaying random images/logos or including text from random files onto your site (writing excerpts, multi-line quotes, etc). Other ideas: random ads, random CSS files, random theme template selection.
Notes:
-
If you want to actually display the name of the random file, be sure to ‘echo’ the results:
-
Unless you limit the file search to only include a particular extension (via
$extensionsargument), all files in the specified$dirwill be under consideration for random selection -
Can be run inside or outside of “the loop”
Links: Plugin Homepage | Plugin Directory Page | GitHub | Author Homepage
Developer Documentation
Developer documentation can be found in DEVELOPER-DOCS.md. That documentation covers the template tags and hooks provided by the plugin.
As an overview, these are the template tags provided by the plugin:
c2c_random_file(): Retrieves the name of a random file from a specified directory and returns information based on the file.c2c_random_files(): Retrieves the name, path, or link to a specified number of randomly chosen files in a specified directory.
These are the hooks provided by the plugin:
c2c_random_file: Filter to safely invokec2c_random_file()in such a way that if the plugin were deactivated or deleted, then your calls to the function won’t cause errors in your site.c2c_random_files: Filter to safely invokec2c_random_files()in such a way that if the plugin were deactivated or deleted, then your calls to the function won’t cause errors in your site.
Installation
- Install via the built-in WordPress plugin installer. Or download and unzip
random-file.zipinside the plugins directory for your site (typicallywp-content/plugins/) - Activate the plugin through the ‘Plugins’ admin menu in WordPress
- Make use of the
c2c_random_file()orc2c_random_files()template function in your code or template (see examples below).
Journal de modifications
Trivial update: fixed some typos in documentation, noted compatibility through WP 6.8+, and updated copyright date (2025).
2.0.1 (2025-04-08)
- Fix: Fix typos in documentation
- Change: Note compatibility through WP 6.8+
- Change: Update copyright date (2025)
- Unit tests:
- Change: Switch uses of
assertRegExp()toassertMatchesRegularExpression()for future PHPUnit 10 compatibility - Change: Explicitly define return type for overridden method
- Change: Switch uses of
2.0 (2024-08-13)
Highlights:
This minor update features improved randomization of file selection, adds support for the extensions argument to be an array, notes compatibility through WP 6.6+, removes unit tests from release packaging, updates copyright date (2024), and other code improvements and minor changes.
Details:
- Change: Switch to using
wp_rand()for more reliable randomization - Change: Allow
$extensionsargument to also accept an array of extensions - Change: Strip surrounding whitespace and leading periods from provided extensions
- Change: Explicitly return false if no file could be found
- Change: Switch to use a switch statement, which is more concise
- Change: Use cleaner
sprintf()approach to outputting markup - Hardening: Escape text shown via ‘hyperlink’ output (though it’s never anything other than plaintext)
- Change: Note compatibility through WP 6.6+
- Change: Update copyright date (2024)
- Change: Tweak filter descriptions in
readme.txt - New: Add
.gitignorefile - Change: Remove development and testing-related files from release packaging
- Unit tests:
- Hardening: Prevent direct web access to
bootstrap.php - Allow tests to run against current versions of WordPress
- New: Add more unit tests
- New: Add
composer.jsonfor PHPUnit Polyfill dependency - Change: In bootstrap, store path to plugin directory in a constant
- Change: Rename a test
- Hardening: Prevent direct web access to
1.8.12 (2023-05-21)
- New: Add DEVELOPER-DOCS.md and move hooks documentation into it
- Change: Note compatibility through WP 6.3+
- Change: Update copyright date (2023)
Full changelog is available in CHANGELOG.md.
Pour les développeurs
Est-ce votre plugin ? Montrez les chiffres.
Ajoutez un badge en direct à votre site, docs ou github readme. Il se met à jour par lui-même - aucun compte n'est nécessaire.
Best Random File alternatives
All coffee2code plugins →FAQ
Random File: quick answers
Réponses directes, extraites des données en direct WordPress.org.
Source : WordPress.org
Is Random File free?
Yes. Random File is free to download and use from the official WordPress.org plugin directory.
Is Random File safe to use in 2026?
Random File shows warning signs in 2026 — compare the alternatives below before installing. It runs on 70+ sites, is rated 5/5 and was last updated 2 years ago, and scores 41/100 on our health check.
How many websites use Random File?
Random File is active on 70+ WordPress websites and has been downloaded 30,092 times since it launched in December 2004. It was downloaded 183 times in the last 30 days.
Does Random File work with WordPress 7.1?
Random File is officially tested up to WordPress 6.8.13, while the latest release is 7.1.5. It may still work, but try it on a staging site first.
When was Random File last updated?
The latest version, 2.0.1, was released on April 8, 2025 (2 years ago).
Who makes Random File?
Random File is developed and maintained by Scott Reilly.
What are the best alternatives to Random File?
The most popular alternatives to Random File are Disable Search (30K+ installs), Configure SMTP (5K+ installs) and One Click Close Comments (5K+ installs).
Propulsé par PageForge
Un modèle et une feuille de calcul. Une vraie page pour chaque recherche.
PageForge transforme chaque ligne d'un CSV en une page WordPress avec son propre titre, URL, SEO et schéma, construit sur la mise en page que vous Déjà conçu. Gratuit sur WordPress.org.
- CSV et XLSX, plus Google Sheets sur les professionnels et les entreprises
- Son propre titre, URL, SEO champs et schéma pour chaque page
- Fonctionne avec l'éditeur de blocs, Elementor, Divi et Avada
- Gratuit sur WordPress.org, pas de carte de crédit
