Connect with us

[WordPress] You don’t have permission to attach files to this post

coding

[WordPress] You don’t have permission to attach files to this post

I got this error message when WordPress user try to upload document using Add Media option.

“You don’t have permission to attach files to this post”

I searched about this issue and found few solutions. Sharing all of them with you so try all, you might get one working for you. 🙂

Solution #1
User role given to user might be corrupted. If you are aware with any Role editing plugin, install it and assign below role to user. User need edit_post role along with below options.

unfiltered_upload
upload_files

Solution #2
If you are developer and have access to PHP files, you can add below code in functions.php file. It will give the role of the author the ability to upload files.

$user_role = ‘author’; // Change user role here
$contributor = get_role($user_role);
$contributor->add_cap(‘upload_files’);

Solution #3
Hopefully either of above 2 will work for you. If none of them works, try this one. Try to add the full file path for the uploads directory under Settings > Media.

If neither of above works for you and you found fix from somewhere else, please do not forget to share with me via comment. I will add it here and it might help someone else like you.

No votes yet.
Please wait...
READ  20+ Must-Have Chrome Extension for Designers and Developers

We are a WordPress plugin developer company that focuses on useful WordPress plugin creation and empowering people to earn passive incomes from their blogs. We build unique and groundbreaking plugins that will revolutionize your blog!

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

More in coding

Sign up for our newsletter and get a free affiliate e-book!


About Me:

Szabi Kisded

Hi, my name is Szabi and I'm documenting my journey selling plugins on CodeCanyon. I will show you every step of it: learning to code, plugin ideas, WordPress stuff and more. Read more…

Mega Plugin Bundle:

CodeCanyon Portfolio:

Learn to Code Plugins:

Latest Promotions:

Recommended Theme:

Start Your Own Blog:

Recommended VPN Service:

Translate Your Blog:

AdSense Alternative:

Best Article Spinner:

Popular Posts:

Latest Posts:

To Top