Don't output specific category on entry page With 

{% for category in entry.categories.all() %}
    &lt;a href="{{ category.url }}"&gt;{{ category.title }}&lt;/a&gt; {{ not loop.last ? '| ' }}
{% endfor %}


How do I exclude a specific category from displaying?
I might be mistaken, but you can just insert an if block into your loop:

{% set excludedId = 1234 %}

{% for category in entry.categories.all() %}
  {% if category.id != excludedId %}
    &lt;a href="{{ category.url }}"&gt;{{ category.title }}&lt;/a&gt;
    {{ not loop.last ? '|' }}
  {% endif %}
{% endfor %}


That said, this will no longer know whether the "last" item in the loop was excluded. A better solution might be to trim down the collection before beginning the iteration:

{% set excludedId = 1234 %}

{% for category in entry.categories.all() | filter((c) =&gt; c.id != excludedId) %}
  &lt;a href="{{ category.url }}"&gt;{{ category.title }}&lt;/a&gt;
  {{ not loop.last ? '|' }}
{% endfor %}


This makes use of the filter filter, which you can pass a "function" of sorts to compare each ID to your excluded one. If the comparison is false, it'll remove it from the collection before the loop starts.

One last option (and possibly the best one) is to adjust the query itself, before it's run:

{% set excludedId = 1234 %}
{% set onlyDesiredCategories = entry.categories.id("not #{excludedId}").all() %}

{% for category in onlyDesiredCategories %}
  &lt;a href="{{ category.url }}"&gt;{{ category.title }}&lt;/a&gt;
  {{ not loop.last ? '|' }}
{% endfor %}


Instead of filtering down from the natural relations, this method attempts to adjust the ElementQuery instance provided by the relation field (entry.categories) by setting the id param to not 1234, meaning that ID will be excluded when the query is executed. I haven't actually tried this lat method, myself, so your mileage may vary.