• Hi, Tom. Congratulations on your plugin. It’s great!

    I was wondering if there’s a way to add rel=”nofollow” to the post links.

    I couldn’t find anything related to it.

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Elvin

    (@ejcabquina)

    Hi,

    To clarify: Do you mean the read more link?

    If so, you can change how the HTML is rendered using wpsp_read_more_output filter.
    https://github.com/tomusborne/wp-show-posts/blob/35e410d7800273fc66f211c0f80d553e95d17f83/inc/functions.php#L236

    Thread Starter danigma

    (@danigma)

    Not in the “read more” link.

    I’m currently displaying only the titles and they are links to the articles.

    For example:

    Other articles you may be interested:

    Title 1
    Title 2
    Title 3

    I’d like to insert a rel=”nofollow” in them if possible.

    Thanks.

    Plugin Support Elvin

    (@ejcabquina)

    Hi,

    As of the moment, there’s no specific filter to add attribute in.

    For now, the workaround is to uncheck “Include title” under WPSP list’s “Content” settings and add this PHP snippet:

    add_filter('wpsp_before_header',function($settings){ 
    	$before_title = sprintf(
    		'<h2 class="wp-show-posts-entry-title" itemprop="headline"><a href="%2$s" rel="bookmark nofollow">',
    		esc_url( get_permalink() )
    	);
    
    	$after_title = '</a></h2>';
    
    	return the_title( $before_title, $after_title );
    
    });
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘How to add rel=”nofollow” ?’ is closed to new replies.