Support » Plugin: Code Snippets CPT » Code Snippets Generating 404 Errors?

  • Hi There,

    A few days ago Google Search Console started flagging up the code snippets as 404 Errors. This is strange because

    – Snippets aren’t pages
    – Snippets are not linked to directly
    – Therefore Google shouldn’t in theory be able to get to them.

    Now being an SEO I can block and disallow these URLs, but maybe if you could take a look at the plugin itself and see why this may have occurred please?

    The site in question currently has over 150 snippets and that’s only going to increase over time. An example URL Google is flagging as Not Found is

    Oh and I don’t want these URLs in the SERPs as nearly all of them are available from pages that embed them.

    Hope you can help – and thanks for your assistance on previous posts!
    Kindest regards,


Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Justin Sternberg


    The snippets are publicly available by default:

    I have no idea where the URL you posted came from (specifically ?code-snippets=180c9ad2cc&id=602 as resolves to an actual snippet page).

    To make snippets no longer be public, use this snippet:

    I posted that link straight out of Google Search Console – i.e. the link/page it was finding the 404 on. It had never happened before but 404s started registering on 23rd August.

    I’m a bit wary about making snippets not public as I still need them on the page but not registering as a link to search bots.

    So for some reason, Google Bot is finding an error 500, but if you go to, say,

    It returns a ‘not found’ error to the user. Now normal people won’t know to go to that kind of URL. The question is how have search engines found those direct links when I just use your shortcode?

    Ah ok, so it’s finding this:

    data-id="246" data-edit="" data-copy="/html5-tutorials/using-html-frames/?code-snippets=62e7b3a0be&id=246" data-fullscreen=""

    And trying to crawl the URLs. Realistically the plugin should be updated to noindex,nofollow these URLs because sites won’t want the snippets indexing as well as the page that contains them.

    Hope this makes some sense!

    Plugin Author Justin Sternberg


    Yah, that does make sense, but it doesn’t make sense that google would crawl those urls from data attributes. Anyway, I’ve pushed an update that will noindex,nofollow those pages if they are stumbled on/crawled when the nonce has expired.

    I’m a bit wary about making snippets not public as I still need them on the page but not registering as a link to search bots.

    Using the snippet I provided will not cause your snippets to disappear from the shortcodes. It will only make the snippet post-type not have permalinks/archives.

    Thanks for pushing the noindex,nofollow out and I’ll apply your code as well. I’ll keep this thread open until Search Console.

    I’ve also reached out to Google to see if there’s a reason GoogleBot is crawling Data Attributes – you’re right, they shouldn’t be.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Code Snippets Generating 404 Errors?’ is closed to new replies.