Fix WordPress Ultimate Member Cover Photo Not Uploading

Ultimate Member is a very widely-used membership WordPress plugin. It works well, but I’ve come across a number of problems with the uploading of member cover photos on multisite WordPress sites. These were so maddening, I decided to write about them and provide solutions to you!

So, here are some things to check if cover photo uploads are not working for you in Ultimate Member on a multisite install.

1. Set Community Role for this User

The symptoms for this problem are that you’ll be able to upload your photo, but after you adjust the visible area and confirm, you’ll see a “missing image” icon in the area where the cover photo should be.  If you look at Chrome Inspector, you’ll see something like this:

chrome-inspector-ultimate-member-error

The first thing to check is the “Community Role” of the user that you’re logged in as.  Actually, this is not entirely easy as there is a bug in UM right now that shows this field as blank, even if it is set as “admin”:

community-role-fix

So, go to Users -> All Users and find the user that you’re logged in as. Check the box on the left and use the “Chage role to….” pulldown to select “admin” and save.  This overcomes one hurdle to being able to upload images.

If WordPress doesn’t let you change this, you might have to log in as a super admin in order to change this role.

2. Enable CORS (Multisite)

If that doesn’t fix your problem, or if you have different symptoms, then CORS might be to blame. The symptom for this is that you can’t even get as far as uploading your photo. When you try, Chrome Inspector gives an error.

“CORS” stands for Cross-Origin Resource Sharing. A bit of background here. Ultimate Member uses AJAX to do this photo upload. Now, there are server settings that prevent AJAX from working across different domain names. If you are using multisite with the Domain Mapping plugin, you might see this problem. The fix is to enable CORS in your .htaccess file.

FTP to the root of your WordPress install, open the .htaccess file, and add this to the top:

Header set Access-Control-Allow-Origin "*"

That should fix it.  For more information on this issue, check out this thread in the Ultimate Member forum with my posting at the end.

3. Check Image File Size

Ultimate Member has limits on what size in pixels and in bytes image you can upload. Go to Ultimate Member -> Settings -> Uploads to check these. PHP also has limits. Check your php.ini file in the root of your site.

4. Fix the “sites” Ultimate Member Bug (Multisite) [NOTE: THIS HAS BEEN FIXED IN ULTIMATE MEMBER 1.3.31]

Okay, this is a freaky and rare one, but it applied to me so I share it with you. This applies if you have the word “sites” anywhere in your domain name. When you try to do a cover photo upload, it will fail and Chrome Inspector will give an error.

The problem is that the word “sites” is used internally by Multisite in the paths to keep your sites straight. Ultimate Member looks for this word in order to construct an upload URL.  Unfortunately, if your domain name contains the word “sites”, things will get screwed up.  The solution (unfortunately) involves tweaking Ultimate Member (at least until they fix this – I have told them about it.

Go to the Ultimate Member plugin directory then to the /core directory and open the file called “um-filters-files.php”.  Find the code below and add the line with my changes while commenting out the line above it.

Viola! Cover photo uploads should work on your site now.

I hope this has helped solve your problems with uploading cover photos in Ultimate Member. If you’ve found other solutions, please let me know by posting below! – Brian

15 thoughts on “Fix WordPress Ultimate Member Cover Photo Not Uploading

  1. Hi Brian!

    Great post.

    I have a error on my website, everytime I try to upload a profile picture appears this error: “data-max_files_error=”you can only upload one image” data-upload_help_text=””>Upload”. I am lost, and is affecting my website.

    Thanks in advance

  2. Hi Brian,

    I have a different snag about the cover. I want to disable cover on my website. But when I do on settings the space of the cover [with a grey background] still shows on the members page. The profile page shows correctly. Do you perhaps know code that I can use on custom css to completely remove it from the members’ page? Or perhaps code to adjust the size of the box to something smaller?

    Kind regards

    1. Hi Caren,

      Looks like the CSS class for the cover is .um-cover. If you do “display:none;” on that it should hide it.

      Best,
      Brian

  3. Hello,

    I have succesfully solved problem with uploading photos but there is absolutely different problem. 3/5 attempts to upload any photo as a profile photo end with unacceptable result. I need to help. Could you contact me on my email martin.95y@gmail.com. I would send you photo of problem and even login information you can try it yourself. I haven’t find problem with uploading photos like this anywhere so I really don’t know what to do. My internet business can’t be released because of that..

    Thanks for any response to email Brian.

  4. Hello,

    I have a problem with Ultimate Member recently. I can’t upload any image because everytime I try to upload post through acitvity extension or only upload cover/profile photo it says “Image is not valid, respectively is too large”.

    I have already tried to reinstall Ultimate Member, reset upload settings, set it to big large but nothing helps.. Could you help me this problem resolve? Text can be uploaded perfectly…

    By the way, site is not completed so is locked! However, there is no error in google developer tool…

      1. Hi! everything is working the way it is supposed to on my site, but I keep getting this error when I click to change a profile photo: “data-max_files_error=”you can only upload one image” data-upload_help_text=””>Upload”

        ***I am not a developer and do not know code

        1. You’re the second person to mention this problem. Leave a comment for the first person in this comment thread to see if they were able to solve it. I haven’t seen it.

          Oh, and if you do solve it, please let me know how you did so I can post it!

          Best,
          Brian

Leave a Comment or Ask a Question