• Resolved agon123

    (@agon123)


    Hi,

    I want to remove the Alt text of this plugin from the feed.

    In my case, the Alt text is “Youtube Video” in the feed.

    Let me know how to remove it.

    • This topic was modified 4 years ago by agon123.

    The page I need help with: [log in to see the link]

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    Well, if you’re into PHP a bit you can hook into the lyte_match_postparse_template filter and str_replace it?

    hope this helps,
    frank

    Thread Starter agon123

    (@agon123)

    No, I don’t know about it! can you please tell me the exact steps to replace alt=”Youtube video” text?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    OK, try this code snippet;

    add_filter( 'lyte_match_postparse_template', 'remove_alt' );
    function remove_alt( $template, $templatetype ) {
      if ( $templatetype == 'feed') {
        $template = str_replace( 'YouTube Video', '', $template );
      }
      return $template;
    }
    Thread Starter agon123

    (@agon123)

    I don’t want to remove it, I want to replace it with any other word.

    If I remove it then it will show an on-page SEO error “Missing alt text in Image”

    Please give a code to replace the alt text.

    • This reply was modified 4 years ago by agon123.
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    sure, just replace your text here in below snippet with what you want;

    add_filter( 'lyte_match_postparse_template', 'remove_alt' );
    function remove_alt( $template, $templatetype ) {
      if ( $templatetype == 'feed') {
        $template = str_replace( 'YouTube Video', 'your text here', $template );
      }
      return $template;
    }
    Thread Starter agon123

    (@agon123)

    Ok thanks, But where to put this code?

    In theme functions.php? or somewhere else?

    Thanks again!

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    The easiest & safest solution is using the code snippets plugin.

    Thread Starter agon123

    (@agon123)

    Receiving this Error after using the above code https://prntscr.com/v9t24u

    How to slove this?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    this should work (well, it does on my end);

    
    add_filter( 'lyte_match_postparse_template', 'remove_alt', 10, 2 );
    function remove_alt( $template, $templatetype ) {
      if ( $templatetype == 'feed') {
        $template = str_replace( 'YouTube Video', 'your text here', $template );
      }
      return $template;
    }
    Thread Starter agon123

    (@agon123)

    Thank you, It is working!

    I Loved your plugin and your support!

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Super ??

    you’re welcome, feel free to leave a review of the plugin and support here. ??

    have a nice weekend!
    frank

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘How to Remove Alt text of Wp Lyte Plugin from feeds’ is closed to new replies.