generate_category_list_output

TheĀ generate_category_list_output filter controls the output of your categories as shown in your post meta along with your blog posts.

For example, we can use this PHP snippet to remove the link attached to the category output:

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' )
    );
} );