WordPress: Remove links from the_category()

The standard way to display the categories a post belongs to is to use the function the_category, e.g, the call the_category(', '); will output:

link, photo, regular, video

As you see the categories are automatically linked to their respective category pages which in most cases is the style needed. Nevertheless there may be situations where you (or your customer) does not want the categories to link anywhere. Unfortunately WordPress does not provide any straightforward method to accomplish this so we have to make a small detour.

There are two ways we can take: rebuild the output or filter the output. Continue reading WordPress: Remove links from the_category()