Why is `djlint` warning me to add `<meta>` tags even though the file is linted?
I'm working on a Django web project and using djlint
to lint and format my HTML templates. I ran the following command to lint one of my templates:
djlint html_files/analytics/reports/report_new.html
And I got this output:
Linting 1/1 files ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 00:00
html_files/analytics/reports/report_new.html
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
H030 3:0 Consider adding a meta description. <html lang="{{ lang
H031 3:0 Consider adding meta keywords. <html lang="{{ lang
Linted 1 file, found 2 errors.
Even though it says "found 2 errors", the file is actually linted and formatted just fine. There’s no crash, and the formatting is applied.
What I want to understand:
- Why are these tagged as errors, when they’re really just recommendations?
- Should these be treated as warnings or ignored?
- Is it best practice to always include
<meta name="description">
and<meta name="keywords">
in Django templates — even for internal dashboards? - How can I suppress or ignore these suggestions if I don’t want to include them?
Let me know if there's a way to configure djlint
to stop flagging these without affecting actual linting or formatting.
What I’ve tried:
- I checked the official djlint documentation, and these are listed under SEO-related suggestions.
- I also tried this command and it worked to silence the warnings:
djlint html_files/analytics/reports/report_new.html --ignore H030,H031
These aren't actual errors — they're linting suggestions provided by djlint
under its HTML best practices rules, specifically for SEO purposes.
What do H030 and H031 mean?
H030
: Suggests adding a<meta name="description">
tag.H031
: Suggests adding a<meta name="keywords">
tag.
These are meant for public-facing web pages to improve search engine visibility, but for internal dashboards or admin panels (like mine), they're not necessary.
Solution 1: Add the tags (if applicable)
If your template is public-facing or you want to follow best practices, you can add the following inside your <head>
:
<meta name="description" content="Create and manage analytic reports like incidents, users, and services.">
<meta name="keywords" content="analytics, reports, incidents, users, services, taskcall">
This will remove the warnings.
Solution 2: Ignore the warnings
If you're building an internal tool and don’t need SEO tags, just suppress these rules:
Option A – Command-line:
djlint html_files/analytics/reports/report_new.html --ignore H030,H031
Option B – Config file (djlint.toml
or .djlintrc
):
ignore = ["H030", "H031"]
Here is a minimal and clean djlint.toml
config file you can include in your project root to automatically ignore those warnings every time you lint:
djlint.toml
# djlint configuration file
# Ignore specific rule codes
ignore = ["H030", "H031"]
# Optional: Set default file types (you can remove this if not needed)
extensions = [".html", ".htm", ".djhtml"]
# Optional: Enable formatting by default (if you use --reformat less often)
format = true
Where to put this?
Place the djlint.toml
file in the root directory of your Django project (same level as manage.py
). djlint
will automatically pick it up when you run:
djlint path/to/templates/