{"id":5185,"date":"2026-08-30T09:30:33","date_gmt":"2026-08-30T00:30:33","guid":{"rendered":"https:\/\/donguri3.net\/server-tech\/rss-validator-cleanup-mysql-2\/"},"modified":"2026-08-30T09:30:35","modified_gmt":"2026-08-30T00:30:35","slug":"rss-validator-cleanup-mysql","status":"publish","type":"post","link":"https:\/\/donguri3.net\/en\/server-tech\/wordpress-blog-seo\/rss-validator-cleanup-mysql\/","title":{"rendered":"Improving RSS Feeds: Resolving Warnings in RSS Validator and Removing Attributes with MySQL"},"content":{"rendered":"<p>In a previous article, we used the <strong>W3C Feed Validator<\/strong> to validate the WordPress RSS feed. At that time, we confirmed its well-formedness as XML and cleared the basic checks. However, in reality, issues remained where some RSS readers and apps failed to display posts correctly due to extraneous attributes. Therefore, this time we used the <a href=\"https:\/\/www.rssboard.org\/rss-validator\/\">official RSS Advisory Board Validator<\/a> to check the feed more strictly.<\/p>\n<h2 class=\"wp-block-heading\">Checking with the RSS Validator<\/h2>\n<p>Upon verification with the Validator, we found that numerous attributes originating from Gutenberg and plugins still remained, such as:<\/p>\n<ul>\n<li>data-start, data-end<\/li>\n<li>data-spread<\/li>\n<li>data-col-size<\/li>\n<li>data-pm-slice<\/li>\n<\/ul>\n<p>While these attributes do not affect browser rendering, they are unnecessary in RSS feeds and can become a factor in reducing compatibility.<\/p>\n<h2 class=\"wp-block-heading\">Batch Removal Using MySQL<\/h2>\n<p>Post contents are stored in the <strong>post_content<\/strong> column of the <strong>wp_posts<\/strong> table. Therefore, we accessed MySQL directly to remove the unnecessary attributes.<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\n-- Remove data-start\nUPDATE wp_posts\nSET post_content = REGEXP_REPLACE(\npost_content,\n&#039;&#x5B;&#x5B;:space:]]data-start=&quot;&#x5B;^&quot;]*&quot;&#039;,\n&#039;&#039;\n)\nWHERE post_content REGEXP &#039;data-start=&#039;;\n\n-- Remove data-end\nUPDATE wp_posts\nSET post_content = REGEXP_REPLACE(\npost_content,\n&#039;&#x5B;&#x5B;:space:]]data-end=&quot;&#x5B;^&quot;]*&quot;&#039;,\n&#039;&#039;\n)\nWHERE post_content REGEXP &#039;data-end=&#039;;\n\n-- Remove data-spread\nUPDATE wp_posts\nSET post_content = REGEXP_REPLACE(\npost_content,\n&#039;&#x5B;&#x5B;:space:]]data-spread=&quot;&#x5B;^&quot;]*&quot;&#039;,\n&#039;&#039;\n)\nWHERE post_content REGEXP &#039;data-spread=&#039;;\n\n-- Remove data-col-size\nUPDATE wp_posts\nSET post_content = REGEXP_REPLACE(\npost_content,\n&#039;&#x5B;&#x5B;:space:]]data-col-size=&quot;&#x5B;^&quot;]*&quot;&#039;,\n&#039;&#039;\n)\nWHERE post_content REGEXP &#039;data-col-size=&#039;;\n\n-- Remove data-pm-slice\nUPDATE wp_posts\nSET post_content = REGEXP_REPLACE(\npost_content,\n&#039;&#x5B;&#x5B;:space:]]data-pm-slice=&quot;&#x5B;^&quot;]*&quot;&#039;,\n&#039;&#039;\n)\nWHERE post_content REGEXP &#039;data-pm-slice=&#039;;\n\n-- Remove data-is-only-node\nUPDATE wp_posts\nSET post_content = REGEXP_REPLACE(\npost_content,\n&#039;&#x5B;&#x5B;:space:]]data-is-only-node=&quot;&#x5B;^&quot;]*&quot;&#039;,\n&#039;&#039;\n)\nWHERE post_content REGEXP &#039;data-is-only-node=&#039;;\n\n-- Remove data-is-last-node\nUPDATE wp_posts\nSET post_content = REGEXP_REPLACE(\npost_content,\n&#039;&#x5B;&#x5B;:space:]]data-is-last-node=&quot;&#x5B;^&quot;]*&quot;&#039;,\n&#039;&#039;\n)\nWHERE post_content REGEXP &#039;data-is-last-node=&#039;;\n\n-- Remove data-blogcard\nUPDATE wp_posts\nSET post_content = REGEXP_REPLACE(\npost_content,\n&#039;&#x5B;&#x5B;:space:]]data-blogcard=&quot;&#x5B;^&quot;]*&quot;&#039;,\n&#039;&#039;\n)\nWHERE post_content REGEXP &#039;data-blogcard=&#039;;\n\n-- Remove data-attributes\nUPDATE wp_posts\nSET post_content = REGEXP_REPLACE(\npost_content,\n&#039;&#x5B;&#x5B;:space:]]data-attributes=&quot;&#x5B;^&quot;]*&quot;&#039;,\n&#039;&#039;\n)\nWHERE post_content REGEXP &#039;data-attributes=&#039;;<\/pre>\n<pre>&nbsp;<\/pre>\n<p>Here, we used <code>[[:space:]]<\/code> to ensure reliable removal even if line breaks or tabs are present in addition to spaces. Since MySQL 5.x does not support <code>REGEXP_REPLACE<\/code>, you would need to repeat <code>REPLACE<\/code> for each individual attribute.<\/p>\n<pre><\/pre>\n<h2 class=\"wp-block-heading\">Verification<\/h2>\n<pre><\/pre>\n<p>After executing the SQL and checking again with the RSS Validator, the warnings related to these attributes disappeared. We also confirmed that articles are now displayed properly in feed readers.<\/p>\n<pre><\/pre>\n<h2 class=\"wp-block-heading\">Future Tasks<\/h2>\n<pre><\/pre>\n<p>Warnings still remain for attributes originating from image tags, such as <code>fetchpriority<\/code>, <code>decoding<\/code>, and <code>sizes<\/code>. Because WordPress adds these automatically, it is safest to add a filter in <code>functions.php<\/code> to remove them only when outputting the feed. In the next post, I plan to summarize how to strip these attributes and further reduce Validator warnings.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In a previous article, we used the W3C Feed Validator to validate the WordPress RSS feed. At that time, we con [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":2124,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"en_US","_original_post":"https:\/\/donguri3.net\/?p=2120","footnotes":""},"categories":[1166],"tags":[551,807,61,799,179],"class_list":["post-5185","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress-blog-seo","tag-luxeritas","tag-rss","tag-wordpress","tag-799","tag-179","en-US"],"_links":{"self":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts\/5185","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/comments?post=5185"}],"version-history":[{"count":1,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts\/5185\/revisions"}],"predecessor-version":[{"id":5188,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts\/5185\/revisions\/5188"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/media\/2124"}],"wp:attachment":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/media?parent=5185"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/categories?post=5185"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/tags?post=5185"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}