WPForms File Rename - Minimal
WPForms file rename plugin using wpforms_process_entry_save hook
by Wembassy · github.com/wembassyco/wpforms-file-rename-kidneyx
★ 0stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/wembassyco/wpforms-file-rename-kidneyx/archive/refs/heads/feature%2Fwpforms-file-rename.zipWordPress plugin that renames uploaded files in WPForms using WPForms 1.10+ compatible hooks.
How It Works
When a form is submitted, this plugin:
- Captures team name early via
wpforms_process_beforehook - Finds Team Name from field ID 2 (or uses timestamp as fallback)
- Generates abbreviation from the form title (e.g., "Submission Portal" → "SP")
- Renames files to pattern:
[TeamName]_[Abbrev]_KidneyXEmpower_Submission.pdf - Updates entry data with the new file URLs
- Deletes original files after successful rename
Filename Formula
[TeamName]_[Abbrev]_KidneyXEmpower_Submission.pdf
- TeamName: Value from field ID 2 (or timestamp if not found)
- Abbrev: First letter of each word in form title (max 5 chars)
- Extension: Preserved from original file
Examples
| Form Title | Team Field Value | Result Filename |
|---|---|---|
| Application Form | Team Alpha | TeamAlpha_AF_KidneyXEmpower_Submission.pdf |
| Submission Portal | Beta Squad | BetaSquad_SP_KidneyXEmpower_Submission.pdf |
| Contact Form | (empty) | 2025-03-19_09-30-15_CF_KidneyXEmpower_Submission.pdf |
Requirements
- WordPress 5.0+
- WPForms plugin 1.10.0+
Installation
- Upload
wpforms-file-rename-kidneyx.phpto/wp-content/plugins/ - Activate in WordPress admin
- Submit a test form with file upload
Hooks Used
wpforms_process_before- Captures team name from form datawpforms_process_after- Renames files after entry is fully saved
Troubleshooting
If files aren't being renamed:
- Check that the form has a field with ID 2 (team name)
- Verify file upload field is properly configured
- Check WordPress error logs for messages
Author
Wembassy