Home / Admin / Add Taxonomy Label to LLMS Term Titles
Duplicate Snippet

Embed Snippet on Your Site

Add Taxonomy Label to LLMS Term Titles

This snippet prepends the taxonomy label to term titles shown in llms.txt and llms-full.txt.

<10
Code Preview
php
<?php
add_filter( 'aioseo_llms_term_title', 'aioseo_filter_llms_term_title', 10, 2 );
function aioseo_filter_llms_term_title( $title, $term = null ) {
    if ( is_a( $term, 'WP_Term' ) ) {
        $taxonomy = get_taxonomy( $term->taxonomy );
        if ( $taxonomy ) {
            $title = $taxonomy->labels->singular_name . ': ' . $title;
        }
    }
    return $title;
}

Comments

Add a Comment