RankMath preventing uploading/removing images in CPT

#141822
  • Resolved Celeste Lombard
    Rank Math pro
    Content AI Starter

    Dear RankMath
    When RankMath is activated I am unable to remove images to my Custom Post Type’s gallery.
    I have done tests and this only happens when the plugin is activated.
    Please could you help?
    Thanks,
    Celeste

Viewing 15 replies - 1 through 15 (of 23 total)
  • Roel John
    Rank Math business

    Hello,

    Thank you for contacting Rank Math.

    We fixed it by adding some CSS code to your admin dashboard. Please see the screenshot below.
    css

    We activate the plugin and test the delete image in your listing and it’s working fine now. Please see the video screenshot.
    https://i.rankmath.com/0IURBO+

    We hope this resolves your issues.

    Thank you.

    Celeste Lombard
    Rank Math pro
    Content AI Starter

    Thank you for helping but now do I have to have the CSS plugin active for it to work. Can I add the CSS to my theme instead?
    Can you tell me why this started happening?

    Danial
    Rank Math business

    Hello,

    You can leave the CSS plugin active for it to work. If you want to add the CSS in your theme, that should work too.

    It seems the issue was that the CSS code was missing and made the gallery not working properly. The new code was added to fix the function.

    I hope this resolves your issues.

    Celeste Lombard
    Rank Math pro
    Content AI Starter

    Hi Daniel
    Thank you for your reply.
    The plugin did fix the problem but I don’t want an additional plugin installed because of speed.
    How can I add the CSS into my theme?
    My theme does have a Custom CSS option but when I added the CSS nothing changed.
    https://ibb.co/rMTgkbj
    Thank you.

    Hello,

    Thank you for keeping in touch with us.

    The custom CSS that you added to your theme settings will not work because that setting was intended for the front end, not for the admin area.

    If you wish to use that custom CSS without any use of a plugin, add this code to your theme’s functions.php file.

    add_action('admin_head', 'my_custom_admin_css_1');
    function my_custom_admin_css_1() {
      echo '<style> .cmb2-media-status .embed-status .cmb2-remove-file-button, .cmb2-media-status .img-status .cmb2-remove-file-button { background: url("https://www.vacations.capetown/detibep/uploads/2021/01/ico-delete.png") !important; }</style>';
    }

    Do note that updating your theme will remove this code if you have added this to your parent’s function.php file. If your theme has a child theme, insert the code there instead.

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Celeste Lombard
    Rank Math pro
    Content AI Starter

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Celeste Lombard
    Rank Math pro
    Content AI Starter

    Hi,
    The Admin CSS MU is not working because I can’t upload images anymore.
    I tried to add the code to my functions.php file but I’m not sure exactly where to put the code? top or bottom?
    Please could you help
    Thank you
    C

    Hello,

    Thank you for the update, and sorry for the delay.

    You should add the code at the last part (very bottom) of your theme’s functions.php file.

    I hope that helps. Thank you, and looking forward to your update.

    Celeste Lombard
    Rank Math pro
    Content AI Starter

    I added it but it’s not working ๐Ÿ™ still can’t upload images to my CPT because of RankMath! https://ibb.co/1XHybST

    Hello,

    Thank you for the update, and sorry for the delay.

    Upon checking your screenshot, it seems that the whole code was placed as a comment. Could you please try deleting the /** on line 22 and */ on line 27? The code should not be color green to make it functional.

    I hope that helps. Thank you, and looking forward to your update.

    Celeste Lombard
    Rank Math pro
    Content AI Starter

    It still doesn’t work
    https://ibb.co/WxFPcGG

    I don’t understand why Rankmath is preventing me from uploading images

    Hello,

    Thank you for following up, and sorry for the delay.

    We have already applied the filter for you, and the uploading of the images is now working. A remove image button is also showing for removing the images in your gallery.

    I hope that helps. Thank you, and please donโ€™t hesitate to contact us if you need further assistance.

    Celeste Lombard
    Rank Math pro
    Content AI Starter

    thank you so much – it works perfectly.

    Hello,

    We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

    Celeste Lombard
    Rank Math pro
    Content AI Starter

    Hi RankMath

    Regarding this thread, I was unable to remove images from my CPT because of RankMath but then Reinelle helped me put a “remove image” button in my function.php file.
    Unfortunately I have updated the theme and lost this code ๐Ÿ™
    Could you please help to put it back? I can’t remove images anymore.

    Thank you very much,
    Celeste

Viewing 15 replies - 1 through 15 (of 23 total)

The ticket ‘RankMath preventing uploading/removing images in CPT’ is closed to new replies.