Escape html structure in php

The answer typically depends on where your translations come from. WordPress core doesn’t usually escape strings such as this, but you may wish to do so in your plugin.

A translation might come from an “untrusted” source and could, in theory, contain malicious JavaScript, and escaping would protect you from this. In reality that’s unlikely, but escaping this text does add another layer of hardening. I’ve started escaping strings such as this in my plugins recently.

In addition, using escaping functions around strings such as this means your code will pass the WordPress Code Standards sniffers.