Archived topic
Post - Author - 301
5 replies · Started by Pascal on February 7, 2020
Hi,
need your help please, tell me how on a post what is the step by step to remove the author link and section category.
It is causing 301 rotation problems on the site, because we prefered to do not publish these page.
top post
https://imgur.com/1s90yYs
end of post
https://imgur.com/bvVGtfB
Thank You.
Hi there,
You can remove the author link like this: https://docs.generatepress.com/article/generate_post_author_output/#remove-link
To remove the category link, try this:
add_filter( 'generate_category_list_output', function() {
$categories = apply_filters( 'generate_show_categories', true );
$term_separator = apply_filters( 'generate_term_separator', _x( ', ', 'Used between list items, there is a space after the comma.', 'generatepress' ), 'categories' );
$categories_list = get_the_category_list( $term_separator );
return sprintf( '<span class="cat-links">%3$s<span class="screen-reader-text">%1$s </span>%2$s</span> ', // WPCS: XSS ok, sanitization ok.
esc_html_x( 'Categories', 'Used before category names.', 'generatepress' ),
strip_tags( $categories_list ),
apply_filters( 'generate_inside_post_meta_item_output', '', 'categories' )
);
} );
Let me know :)
Thank you this code need to be added in the CSS file ?
That would be PHP;
https://docs.generatepress.com/article/adding-php/
Thank you it works and it fixes now.
Glad I could help :)