Required on parent container causes 404 errors from term names in inline style

  • Hi,

    When I enable Required on a parent container with a dynamic term list, the term names get output as background image
    URLs in the container’s inline style (–inline-bg-image). Crawlers parse these as real paths and attempt to fetch them, generating mass 404 errors like:

    /post-slug/TermName

    Removing the inline style stops the 404s but breaks Required — labels show on posts with no terms assigned.

    Is there a way to use Required on a parent container without the term list being injected into the inline style?

  • Hi there,

    I’m not sure I understand the issue.

    I checked the links you provided; they seem to be normal.

    Can you make it more specific? Like, which container on which page is the one in question?

  • Hi Ying,

    All are in the header elements.
    You may be getting redirects for some (to unrelated pages) but these shouldn’t even exist as URLs.
    I understand that these are triggered by BG image styles which are applied by the “Required to render” for the parent containers.

    –inline-bg-image: url(<span>TermName</span>);

    Details in private.

  • You should NOT add dynamic tags to the container, as you are not trying to pull dynamic data for the container.

    I’m not sure why you do so in the first place, are you trying to disable the entire container if the text block does not return the term list?

  • Yes, the Required to render is applied to the container so it doesn’t show if no terms.
    In some cases we have the term list as pills (GB headline/text) and also in SVG via shortcode and we need the labels to be text. We’re trying not to render the labels if no terms are listed. It works fine except for the crawl errors.

    What would be the correct way to do it?

  • You can use CSS to hide the container if there’s no term returned for the text block.

  • Yeah, sure, we’ll use css if there’s no way to do it via GB.

    Thanks Ying for your help.

  • You are welcome   🙂

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.