I have a function that rewrites the URL before post slug including a custom taxonomy function wpa_show_permalinks( $post_link, $post ){ if ( is_object( $post ) && $post->post_type == ‘aktuelles’ ){ $terms = wp_get_object_terms( $post->ID, ‘nachrichtenkategorie’ ); if( $terms ){ return str_replace( ‘%nachrichtenkategorie%’ , $terms[0]->slug , $post_link ); } } return $post_link; } add_filter( ‘post_type_link’, ‘wpa_show_permalinks’, 1, 2 ); The function works just fine and replaces %nachrichtenkategorie% in URL when accessing from the archive Getting the permalink of a post with…