• I’m new to theme dev, but I try my best to write clean code. And I noticed that WP outputs different quotes to HTML attribute values.

    For example, I get lang=”en-US” but at the same futher down the code I see name=’robots’ content=’noindex,follow’.

    Why is that? Is there a way to leverage WP to use only ‘ or ” instead of both? I’m aware that standart permits this both ways, but it’s much easier to read code in one style.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Some tags like dns-prefetch or robots meta are hardcoded in WordPress core with single quotes. The only way you may make it like the rest of HTML is to post-process it via output buffering (ob_start PHP function).

    But you really don’t need to. It’s valid HTML.

Viewing 1 replies (of 1 total)
  • The topic ‘WordPress HTML attributes values with different quotes – how to fix this?’ is closed to new replies.