Documentation
Everything you need to install, configure and extend Renamly — from your first rename to WP-CLI, filters, cascading naming methods and troubleshooting.
Renamly ships as a standard WordPress plugin. It requires WordPress 6.0+ and PHP 7.4+ (PHP 8.1+ recommended). WooCommerce is optional — Renamly detects it automatically and lights up product-aware features when it's present.
Head to Media → Renamly Dashboard. Every media entry appears with its current filename, the proposed new filename, and a Rename Nowbutton. Try a single rename first, confirm it looks right in your posts, then run a bulk pass with confidence.
A naming method is the rule Renamly uses to decide what a file should be called. Pick one as your default in Renamly → Settings → Naming.
Real libraries are messy — some images are attached to products, some to posts, some to nothing. Cascading lets you chain naming methods with automatic fallback, so every file gets the best available name.
In Settings → Naming → Cascade, drag methods into priority order. Renamly walks the list top-down and uses the first one that produces a valid result:
1. Product-aware → attached to a WooCommerce product? use it
2. Attached-post title → attached to any post/CPT? use its title
3. AI vision → key configured? describe and name
4. Numbered → last resort, never failsRenamly can rename on three events: new upload, media title change, and — for WooCommerce — product title change. Toggle each independently.
If you edit media titles from inside the post editor, Renamly can't rename immediately without breaking the images you're currently referencing. With Rename on save enabled, Renamly queues the change and applies it when the post is saved, drafted, scheduled or published — links get rewritten in the same transaction, so the post keeps rendering.
With this option off, queued renames wait for you in the Renamly dashboard. Click Rename Now to apply them one at a time.
Renaming a file is only half the job. Renamly rewrites every reference to the old filename in the same operation, across:
Pro writes a permanent 301 from every old file URL to its new one. External sites, Google image results and cached emails keep working. Redirects live in a lightweight table Renamly manages — no .htaccess edits — and are automatically cleaned up when you undo a rename.
A file rename is a good moment to keep the media's textual metadata in sync. Renamly can optionally update the media entry's Title, ALT text, Caption and Description whenever it renames a file — one consistent story per image, great for SEO and screen readers.
Use the renamly_rewrite_alt filter to append your brand name, product SKU, or any string. See Filters below.
Every rename is logged with the old filename, new filename, timestamp, user and method. One click restores the previous filename and reverses every reference rewrite Renamly made in the same operation — including the 301 redirect.
Lock any file to permanently exclude it from auto-rename, bulk runs, and title sync. Locked files still appear in the dashboard, marked with a so you know why they're being skipped.
The dashboard filters media into four groups so you can prioritize work:
Bulk mode is designed for libraries with thousands of files on shared hosts with 30-second PHP timeouts. Renamly processes media in small, checkpointed batches over AJAX — safe to close the tab and resume later. The runner picks up exactly where it left off.
Renamly reads three signals to decide which product an image belongs to, in this priority order:
For variation images, Renamly appends the variant attributes automatically — e.g. -black-large — so every SKU has a uniquely named image. Optional: append the SKU too ( -SKU123) via a single toggle.
Orphan product images — sitting in the media library with no post_parent — are common after CSV imports and page-builder work. Auto-attach scans them and suggests a product based on:
Review the suggestions queue and accept them one at a time, or bulk-accept when the confidence score is above a threshold you pick.
Renamly does not bundle an AI key or proxy your images through our servers. You bring your own Anthropic or OpenAI key, paste it in Settings → AI, and Renamly calls the provider directly from your WordPress site with your billing.
Renamly ships WP-CLI commands for migrations, staging refreshes and CI. All commands respect your dashboard settings unless overridden by a flag.
# rename a single media entry
wp renamly rename 4821
# rename everything, small batches, resume-safe
wp renamly bulk --batch=50
# preview only — no changes on disk or in DB
wp renamly bulk --dry-run
# auto-attach orphan product images (WooCommerce)
wp renamly attach --min-confidence=0.8
# undo the last N renames
wp renamly undo --limit=100
# rebuild the 301 redirect table from the history log
wp renamly redirects rebuildBy default only administrators (users with manage_options) can access the Renamly dashboard and its settings. Override with two filters:
// let editors use the Renamly dashboard
add_filter( 'renamly_allow_usage', function ( $allow ) {
return current_user_can( 'editor' ) || $allow;
} );
// let a custom capability access the settings
add_filter( 'renamly_allow_setup', function ( $allow ) {
return current_user_can( 'manage_renamly' ) || $allow;
} );Renamly exposes a small, stable API of filters and actions. All are prefixed with renamly_.
Prepend the upload date to every name:
add_filter( 'renamly_new_filename', function ( $new, $old, $media ) {
$date = date( 'Y-m-d', strtotime( $media['post_date'] ) );
return $date . '-' . $new;
}, 10, 3 );Pro adds a variant that also receives the attached post — handy for stores that want the product slug baked in even when using a different naming method:
add_filter( 'renamly_new_filename_attached', function ( $new, $old, $media, $attached ) {
return $new . '-' . sanitize_title( $attached['post_title'] );
}, 10, 4 );add_filter( 'renamly_replace_rules', function ( $rules ) {
$rules['ß'] = 'ss';
$rules['&'] = 'and';
return $rules;
} );add_filter( 'renamly_rewrite_alt', function ( $alt, $media ) {
return trim( $alt . ' – ' . get_bloginfo( 'name' ) );
}, 10, 2 );add_filter( 'renamly_allow_rename', function ( $allow, $media, $proposed ) {
// never rename files in a specific folder
if ( strpos( $media['file'], 'do-not-touch/' ) === 0 ) {
return false;
}
return $allow;
}, 10, 3 );add_action( 'renamly_path_renamed', function ( $media_id, $old_path, $new_path ) {
// register a redirect, ping a CDN, log to Slack, etc.
}, 10, 3 );
add_action( 'renamly_url_renamed', function ( $media_id, $old_url, $new_url ) {
// sync references in a page builder that stores URLs oddly
}, 10, 3 );If a third-party importer creates posts or uploads media programmatically, WordPress often doesn't fire the events Renamly listens to. Trigger a rename yourself once your import finishes:
// after your importer finishes uploading:
foreach ( $imported_media_ids as $id ) {
renamly_rename( $id );
}Useful WordPress action hooks to piggyback on:
Renamly transliterates accented characters and non-Latin scripts into clean ASCII slugs (Café → cafe, Токио → tokio). This keeps URLs readable everywhere, avoids CDN edge cases, and eliminates a whole class of encoding bugs on shared hosts.
Linux and modern macOS filesystems are case-sensitive: Cat.JPG and cat.jpg are two different files. Windows and some managed hosts are case-insensitive, so copying Cat.JPG over cat.jpg silently overwrites it. Enable Case-insensitive checks in Settings if you're on Windows/IIS — small performance cost, big safety win. Leave it off on standard Linux hosts.
If you moved WordPress between hosts and see broken accented filenames, the DB and the filesystem probably disagree on encoding. Fix: re-upload /wp-content/uploads/ from the source host via FTP with UTF-8 enforced. Renamly can then take over cleanly.
Manual filename editing requires Pro and the Manual Renaming setting toggled on in Renamly → Settings.
Turn on Debug logging in Settings. Renamly writes to a rolling log at /wp-content/uploads/renamly-logs/ — include the latest log with any support ticket.
Pro comes with priority support. Send us your debug log and a screenshot — most tickets are resolved same-day.