{"id":3337,"date":"2025-07-31T14:40:43","date_gmt":"2025-07-31T21:40:43","guid":{"rendered":"https:\/\/us.wordcamp.org\/2025\/?post_type=wcb_session&#038;p=3337"},"modified":"2025-09-04T16:24:45","modified_gmt":"2025-09-04T23:24:45","slug":"tag-team-your-blocks-customizing-gutenberg-with-wp_html_tag_processor","status":"publish","type":"wcb_session","link":"https:\/\/us.wordcamp.org\/2025\/session\/tag-team-your-blocks-customizing-gutenberg-with-wp_html_tag_processor\/","title":{"rendered":"Tag Team Your Blocks: Customizing Gutenberg with WP_HTML_Tag_Processor"},"content":{"rendered":"\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<span class=\"embed-youtube\" style=\"text-align:center; display: block;\"><iframe loading=\"lazy\" class=\"youtube-player\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/QRSIA2ZgbxI?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=en-US&#038;autohide=2&#038;wmode=transparent\" allowfullscreen=\"true\" style=\"border:0;\" sandbox=\"allow-scripts allow-same-origin allow-popups allow-presentation allow-popups-to-escape-sandbox\"><\/iframe><\/span>\n<\/div><\/figure>\n\n\n\n<p>Ever wished you could add a little something extra to a Gutenberg block\u2019s HTML without resorting to hacky workarounds? Meet the WP_HTML_Tag_Processor \u2013 a powerful yet approachable tool in WordPress core that lets you modify HTML tag attributes on the fly. We\u2019ll explore how to harness this new API to safely tweak the output of core blocks and make them do your bidding (no advanced wizardry required, but having some knowledge on how to customize blocks would be helpful!).<\/p>\n\n\n\n<p>We\u2019ll start with a quick intro to what WP_HTML_Tag_Processor is and why it makes customizing blocks easier (hint: no more fragile regex or heavy DOM parsing). Then we\u2019ll dive into practical examples that developers of all levels can appreciate. For instance, you\u2019ll learn how to lazy-load videos (both the core block and cover). Next, we\u2019ll show how to sprinkle custom attributes on column blocks (imagine adding a role when the columns are more representative of a list) to adapt core layouts to your project\u2019s needs.<\/p>\n\n\n<div class=\"wp-block-wordcamp-session-speakers\"><span class=\"wp-block-wordcamp-session-speakers__byline\">Presented by<\/span><span class=\"wp-block-wordcamp-session-speakers__name\"><a href=\"https:\/\/us.wordcamp.org\/2025\/speaker\/rory-heaney\/\">Rory Heaney<\/a><\/span><\/div>","protected":false},"excerpt":{"rendered":"<p>Ever wished you could add a little something extra to a Gutenberg block\u2019s HTML without resorting to hacky workarounds? Meet the WP_HTML_Tag_Processor \u2013 a powerful yet approachable tool in WordPress core that lets you modify HTML tag attributes on the fly. We\u2019ll explore how to harness this new API to safely tweak the output of [&hellip;]<\/p>\n","protected":false},"author":7674337,"featured_media":0,"template":"","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_wcpt_session_time":1756500300,"_wcpt_session_duration":2700,"_wcpt_session_type":"session","_wcpt_session_slides":"","_wcpt_session_video":"","_wcpt_speaker_id":[1990],"footnotes":""},"session_track":[58],"session_category":[64],"class_list":["post-3337","wcb_session","type-wcb_session","status-publish","hentry","wcb_track-track-2-rose-city","wcb_session_category-topic-technical"],"jetpack_shortlink":"https:\/\/wp.me\/pfz0Bf-RP","jetpack_sharing_enabled":true,"session_date_time":{"date":"August 29, 2025","time":"1:45 pm"},"session_speakers":[{"id":"1990","slug":"rory-heaney","name":"Rory Heaney","link":"https:\/\/us.wordcamp.org\/2025\/speaker\/rory-heaney\/"}],"session_cats_rendered":"Technical WordPress","_links":{"self":[{"href":"https:\/\/us.wordcamp.org\/2025\/wp-json\/wp\/v2\/sessions\/3337","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/us.wordcamp.org\/2025\/wp-json\/wp\/v2\/sessions"}],"about":[{"href":"https:\/\/us.wordcamp.org\/2025\/wp-json\/wp\/v2\/types\/wcb_session"}],"version-history":[{"count":3,"href":"https:\/\/us.wordcamp.org\/2025\/wp-json\/wp\/v2\/sessions\/3337\/revisions"}],"predecessor-version":[{"id":8807,"href":"https:\/\/us.wordcamp.org\/2025\/wp-json\/wp\/v2\/sessions\/3337\/revisions\/8807"}],"speakers":[{"embeddable":true,"href":"https:\/\/us.wordcamp.org\/2025\/wp-json\/wp\/v2\/speakers\/1990"}],"author":[{"embeddable":true,"href":"https:\/\/us.wordcamp.org\/2025\/wp-json\/wporg\/v1\/users\/rorymheaney"}],"wp:attachment":[{"href":"https:\/\/us.wordcamp.org\/2025\/wp-json\/wp\/v2\/media?parent=3337"}],"wp:term":[{"taxonomy":"wcb_track","embeddable":true,"href":"https:\/\/us.wordcamp.org\/2025\/wp-json\/wp\/v2\/session_track?post=3337"},{"taxonomy":"wcb_session_category","embeddable":true,"href":"https:\/\/us.wordcamp.org\/2025\/wp-json\/wp\/v2\/session_category?post=3337"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}