Prevent Rank Math from putting alt and title attributes on images

#719914
  • Resolved Giuliano Ciolino
    Rank Math free

    How do I prevent Rank Math from putting alt and title attributes on images generated by the Popular Post, YARPP, Blog and Category plugins?

    There is no option to exclude. Since these elements have the title and description, having the tag and title attributes are redundant and even duplicated, since we have the featured image.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hello, I’m sorry to hear about the issue you’re facing with Rank Math. To prevent Rank Math from adding alt and title attributes to images generated by the Popular Post, YARPP, Blog, and Category plugins, you can use a filter to remove the Rank Math SEO tags from specific pages.

    You can add the following code snippet to your theme’s functions.php or rank-math.php file:

    /**
     * Function to disable SEO Tags generated by Rank Math
     */
    function rankmath_disable_features() {
        if ( is_singular( 'page' ) ) {
            remove_all_actions( 'rank_math/head' );
        }
    }
    add_action( 'wp_head', 'rankmath_disable_features', 1 );

    Replace the is_singular('page') condition with the appropriate condition for the pages where you want to prevent Rank Math from adding alt and title attributes to images.

    Once you’ve added the code, click the Update File button to save the changes. This code will remove the SEO tags generated by Rank Math on the specified pages.

    If you have any further questions or need assistance with this, please feel free to ask.

    Sources:
    How to Automatically Set Alt and Title Attributes for Images
    How to Show Images in the Search Results » Rank Math
    Image SEO Options in Rank Math
    How to Disable All Rank Math Generated SEO Tags » Rank Math

    Hello,

    Thank you for contacting us and sorry for any inconvenience that might have been caused due to that.

    You can disable the Add missing ALT attributes and Add missing TITLE attributes options from Rank Math > General Settings > Images. Unfortunately, right now we don’t have any option to exclude specific images/posts.

    However, please note that Rank Math only includes the ALT and Title attributes to the images that don’t have these attributes.

    Hope that helps and please don’t hesitate to let us know if you have any other questions.
     
    Thank you.

    I can’t find a way to add the title attribute to the images, since they are not in the post, but as featured images.

    Can you help add a snippet that prevents alt and title attributes on certain plugins?

    Also, can having thumbnails and alt and title attributes create duplicate problems?

    Hello,

    The settings from our plugin cannot be enabled or disabled on a particular set of pages or for some images from a particular set of plugins. They are booleans, which means they are either enabled or disabled.

    Regarding the question about the thumbnails, if the thumbnails use the same exact image that is available on the page you are essentially duplicating the HTML markup. In most cases, duplicate markup will not cause any issues on Google, but if that’s something you want to take control of, you need to pay close attention to that.

    Don’t hesitate to get in touch if you have any other questions.

    For SEO; Could this duplication of featured images be a problem?

    Hello,

    This might not impact the SEO directly but since it’s actual content on the pages, it will add size to the HTML, and the lower the HTML payload the better.

    The extent of that depends on the amount of duplications but this would not be something that should be on a priority list unless it really starts causing the HTML payload to become extensively larger.

    Don’t hesitate to get in touch if you have any other questions.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 7 replies - 1 through 7 (of 7 total)

The ticket ‘Prevent Rank Math from putting alt and title attributes on images’ is closed to new replies.