List a post's terms without permalinks

Last modified September 24, 2019
.* :☆゚

There are many ways to get a post’s terms in WordPress, but if you just want to list them out, with separators, and without links, navigating the different functions to do so can be annoying.

This is the easiest and most hassle-free way I have found to list a post’s terms with separators, using WordPress’ in-built functions.

<?php
$terms = get_the_term_list( get_the_ID(), '__YOUR TAXONOMY HERE__', $before,$separator,$after );
$terms = strip_tags( $terms );
echo $terms;

//real world example
$terms = get_the_term_list( get_the_ID(), 'houses', '<div class="features">',', ','</div>' );
$terms = strip_tags( $terms );
echo $terms;