• Hi, Trying to hide image title attribute from appearing when hovering over an image in my store. I have added the following code to my functions.php using the Code Snippets plugin, which I use for a number of things just fine, yet the title attribute still appears.

    What am I doing wrong and what will work for this?

    TIA

    // Title Removal from WordPress image
    add_filter( 'wp_get_attachment_image_attributes', 'remove_image_text');
    function remove_image_text( $attr ) {
    unset($attr['title']);
    return $attr;
    }

    Themify Shoppe, WP v6.0.3

    • This topic was modified 2 years, 4 months ago by ??????????????. Reason: Added theme & WP version
Viewing 5 replies - 1 through 5 (of 5 total)
  • Saif

    (@babylon1999)

    Hello @periago,

    I’m not sure what exactly are you referring to, are these attributes showing on the Admin or public view of your site?

    Can you please attach some screenshots of it? You can use a service like https://imgur.com/upload.

    Look forward to hearing back from you.

    Thread Starter ??????????????

    (@periago)

    Thanks for your reply @babylon1999

    It happens in admin and public, the title attributes of images appear when hovering over product images. I thought the code I posted above would remove it but it doesn’t and I cannot figure another way to remove this function. This video link may help you understand what I’m trying to remove.

    Hello,

    I was checking the code, and it is working for me, I did not add the code in the functions.php file, but I added it using the Code Snippets to add custom PHP code into your site without directly accessing the functions.php file. Here is an article that explains how to use the Code Snippets plugin.

    Can you please try this way to confirm if it is working for you?

    Thread Starter ??????????????

    (@periago)

    @ihereira yes, like I stated I added it using Code Snippets. I guess if it works for you and not for me then it may be a theme issue, so I will post to my theme support. Thank you for your help.

    Hi @periago

    I guess if it works for you and not for me then it may be a theme issue, so I will post to my theme support.

    Let us know how it goes and hopefully, the issue could be resolved soon.

    Cheers!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to remove/hide image title from WordPress media images on hover’ is closed to new replies.