{"id":451,"date":"2009-09-15T16:09:00","date_gmt":"2009-09-15T22:09:00","guid":{"rendered":"http:\/\/jaredrobinson.com\/blog\/?p=451"},"modified":"2009-09-15T16:09:00","modified_gmt":"2009-09-15T22:09:00","slug":"vim-multi-line-search-and-replace-for-wordpress-comments","status":"publish","type":"post","link":"https:\/\/jaredrobinson.com\/blog\/vim-multi-line-search-and-replace-for-wordpress-comments\/","title":{"rendered":"Vim multi-line search-and-replace for wordpress comments"},"content":{"rendered":"<p>When I switched web hosting providers, I migrated my wordpress instance by exporting to wordpress XML format (as opposed to doing a SQL export).<\/p>\n<p>I didn&#8217;t want the SPAM comments to be imported into the new wordpress instance, so I used vim multi-line search and replace to delete the unwanted comments from the XML.<\/p>\n<p>    :%s#<wp:comment>\\_.\\{-}<.wp:comment>##<\/p>\n<p>I gleaned that syntax from from [http:\/\/osdir.com\/ml\/editors.vim\/2002-06\/msg00468.html](http:\/\/osdir.com\/ml\/editors.vim\/2002-06\/msg00468.html)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When I switched web hosting providers, I migrated my wordpress instance by exporting to wordpress XML format (as opposed to doing a SQL export). I didn&#8217;t want the SPAM comments to be imported into the new wordpress instance, so I used vim multi-line search and replace to delete the unwanted comments from the XML. :%s#\\_.\\{-}## &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/jaredrobinson.com\/blog\/vim-multi-line-search-and-replace-for-wordpress-comments\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Vim multi-line search-and-replace for wordpress comments&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-451","post","type-post","status-publish","format-standard","hentry","category-tech"],"_links":{"self":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts\/451","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/comments?post=451"}],"version-history":[{"count":4,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts\/451\/revisions"}],"predecessor-version":[{"id":455,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts\/451\/revisions\/455"}],"wp:attachment":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/media?parent=451"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/categories?post=451"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/tags?post=451"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}