---
title: '{% ifequal %}'
description: '**Removed.** Use `{% if a == b %}` instead.'
date: '2026-08-02'
categories:
  - Template Tag
  - Logic
canonical: https://djangotemplatetagsandfilters.com/tags/ifequal/
deprecated_in_version: '3.1'
removed_in_version: '4.0'
doc_link: >-
  https://docs.djangoproject.com/en/6.0/ref/templates/builtins/#ifequal-and-ifnotequal
---

# {% ifequal %}

**Removed.** Use `{% if a == b %}` instead.

## Documentation

> ### Removed in Django 4.0
> The `ifequal` tag was deprecated in Django 3.1 and **removed in Django 4.0**.
> Use `{% if a == b %}` instead.

The `ifequal` tag compared two values and displayed the contents of the block if they were equal.

### Old Syntax (No Longer Works)

```django
{% ifequal user.username "admin" %}
  Welcome, admin!
{% endifequal %}
```

### New Syntax

```django
{% if user.username == "admin" %}
  Welcome, admin!
{% endif %}
```

## Commentary

This tag no longer exists. Use the [`if`](/tags/if/) tag with the `==` operator instead.
