{"id":19013792,"date":"2026-09-07T18:05:44","date_gmt":"2026-09-07T18:05:44","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/hiding-some-snipptes\/"},"modified":"2026-09-07T18:35:40","modified_gmt":"2026-09-07T18:35:40","slug":"hiding-some-snipptes","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/hiding-some-snipptes\/","title":{"rendered":"Hiding some snippets"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>Snippet counts in the snippets table do not match the database (3.10.2)<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After updating from 3.9.6 to 3.10.2, the snippets list page shows fewer snippets than actually exist. The plugin&#8217;s own admin bar menu reports the correct numbers, so the two counters inside the plugin disagree with each other.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>What the database contains<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT active, COUNT(*) FROM wp_snippets GROUP BY active;\n\nactive  COUNT(*)\n0       66\n1       64<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Total: 130 snippets \u2014 64 active, 66 inactive.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>What the admin bar menu shows<\/strong> (correct)<\/p>\n\n\n\n<ul>\n<li>Active snippets (64)<\/li>\n\n\n\n<li>Inactive snippets (66)<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>What the snippets table shows<\/strong> (incorrect)<\/p>\n\n\n\n<ul>\n<li>All Snippets 100<\/li>\n\n\n\n<li>All (100) | Active (43) | Inactive (57)<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Pagination reads &#8220;100 items, Page 1 of 1&#8221;, so this is not a paging issue \u2014 30 snippets are simply missing from the list, 21 of them active.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before the update, on 3.9.6, the same page showed All (130) | Active (64) | Inactive (66), matching the database.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Impact<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The missing snippets still execute normally, so this appears to be a display\/query problem rather than data loss. But there is no way to edit or deactivate them from the UI, which is a serious problem on a site with a large number of snippets.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Environment<\/strong><\/p>\n\n\n\n<ul>\n<li>Code Snippets 3.10.2 (updated from 3.9.6)<\/li>\n\n\n\n<li>Table name is <code>wp_snippets<\/code>, while WordPress core tables use the <code>wp_1_<\/code> prefix<\/li>\n\n\n\n<li>Shared hosting, LiteSpeed, PHP-FPM, MySQL<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The unusual prefix combination may be relevant, given that 3.10.0 included a fix for &#8220;network snippet lookups using the wrong database table on multisite&#8221;.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Happy to run any queries or provide further details.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/enumis.shop\/PIX\/somenew.jpg?ssl=1\" alt=\"\" \/><\/figure>\n","protected":false},"template":"","class_list":["post-19013792","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19013792","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19013792\/revisions"}],"predecessor-version":[{"id":19013794,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19013792\/revisions\/19013794"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=19013792"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}