Is it safe to ignore the warnings when making and editing templates?

Hi Eliot and everyone!

When editing templates from the WP backend, I get warnings about not using IDs in the HTML/CSS and not using things like let in the JS.

However, I tested it out, and everything seems to work just fine regardless.

Is it okay to just ignore those warnings?

All the best

Hi Mikkel,

Yes, the warnings (in yellow) in the template editor can be safely ignored. The syntax errors (in red) are more relevant/important.

Some of the syntax rules are probably unnecessary and too distracting, so perhaps there can be a plugin setting to disable them - or at least the rules can be improved to show only the minimum necessary errors. I’ve made a note to look into it.

Thank you for getting back to me, Eliot.

I supposed the warning for “no-ids” is in case the templates are reused, right? I am facing a small problem with some javascript, where I kinda-sorta need to use IDs, but I am getting the warning.

It still works however, at least with this one instance.

Cheers

Yes, the no-ids rule is there to inform that it’s preferable to use classes instead of IDs, in case the template is used multiple times on a page. Perhaps for most templates this is not relevant. The warning is only shown in the editor and has no effect on the functioning of the template, so you can safely ignore it.