---
title: How to Restrict File Renaming by User Role or Post Type
description: Rename WordPress uploads only for specific user roles or post types, and how a blank setting behaves. Pro.
url: "https://wpfactory.com/docs/restrict-file-renaming-by-user-role-or-post-type/"
updated: "2026-09-27"
category: Pro Features
---

# How to Restrict File Renaming by User Role or Post Type

By default, [Rename Media Files: Improve Your WordPress SEO](https://wpfactory.com/item/file-renaming-on-upload-wordpress-plugin/) applies your renaming rules to every upload. Pro lets you narrow that down so files are only renamed for specific user roles or specific post types. This is useful when you want the renaming logic to run for, say, editors uploading to products but not for other users or contexts. Both options are on the **General Settings** tab under **WPFactory > File Renaming**.

### Allowed user roles

The **Allowed user roles** option (`restrict_user_role`) is a multiselect where you pick the roles for which renaming should run. When you select one or more roles, only uploads by users in those roles are renamed. Leave it blank to apply renaming to all roles.

### Allowed post types

The **Allowed post types** option (`restrict_post_type`) is a multiselect where you pick the post types for which renaming should run. When you select one or more post types, only files attached to those post types are renamed. Leave it blank to apply renaming to all post types.

### How blank works

A blank selection means no restriction, so renaming runs everywhere. You only need these options when you want to limit renaming. If both are left blank, Rename Media Files behaves as it does without any restriction and processes all uploads.

### Options

| Label | Option ID | Type | Default | Free/Pro |
| --- | --- | --- | --- | --- |
| Allowed user roles | `restrict_user_role` | Multiselect | Blank (all roles) | Pro |
| Allowed post types | `restrict_post_type` | Multiselect | Blank (all post types) | Pro |

### Ready to set this up?

This is a Pro feature of [Rename Media Files](https://wpfactory.com/item/file-renaming-on-upload-wordpress-plugin/). If you are still on the free version, upgrading unlocks this along with the rest of the Pro toolkit. [Get Rename Media Files Pro](https://wpfactory.com/item/file-renaming-on-upload-wordpress-plugin/).

Related articles

- [Advanced File Renaming: Managing Exceptions in Pro](https://wpfactory.com/docs/advance/)
- [File Renaming Settings Reference](https://wpfactory.com/docs/file-renaming-settings-reference/)
- [File Renaming Hooks and Filters Reference](https://wpfactory.com/docs/file-renaming-hooks-and-filters/)
- [How to Create a Custom File Renaming Rule](https://wpfactory.com/docs/create-custom-file-renaming-rule/)
- [File Renaming on Upload Pro: Troubleshooting Tips](https://wpfactory.com/docs/pro-troubleshooting-tips/)
