{"id":23663,"date":"2018-03-29T14:20:13","date_gmt":"2018-03-29T14:20:13","guid":{"rendered":"https:\/\/wpgeodirectory.com\/docs\/?p=23663"},"modified":"2018-03-29T14:20:13","modified_gmt":"2018-03-29T14:20:13","slug":"better-search-replace-plugin","status":"publish","type":"post","link":"https:\/\/wpgeodirectory.com\/docs\/better-search-replace-plugin\/","title":{"rendered":"Better Search Replace plugin"},"content":{"rendered":"<ol>\n<li><a href=\"https:\/\/wordpress.org\/plugins\/better-search-replace\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Better Search Replace<\/a>\u00a0will assist with changing URLs or slugs etc in your database.<\/li>\n<li><i class=\"fa fa-exclamation-triangle fa-2x\" style=\"color: red;\"><\/i>It is also very helpful when changing your site from HTTP to HTTPS.<\/li>\n<\/ol>\n<h3>Changing slugs that have -1 appended<\/h3>\n<ol>\n<li>Sometimes when you add a new location or category etc, the slug [part URL] might get a \u201c-1\u201d appended. For example\u00a0<em><strong>mysite.com\/location\/east-sussex-1\/<\/strong><\/em><\/li>\n<li>This happens because WP does not allow duplicate slugs, and there already is something else using the slug <em><strong>east-sussex<\/strong><\/em>.<\/li>\n<li>This\u00a0can\u00a0be a tag, or a post name etc.<\/li>\n<li>It can also still be in the database from an old plugin you deleted.<\/li>\n<li>The solution is to search the database for the slug <em><strong>east-sussex<\/strong><\/em>\u00a0and change it to <em><strong>east-sussex<\/strong><\/em><em><strong>-2<\/strong><\/em><\/li>\n<li>Then search for <em><strong>east-sussex<\/strong><\/em><em><strong>-1<\/strong><\/em>\u00a0and replace all results (except the one you just changed) with <em><strong>east-sussex<\/strong><\/em>.<\/li>\n<\/ol>\n<h4>First replace the &#8220;correct&#8221; slug in the database<\/h4>\n<ol>\n<li>Go to your database using <em><strong>phpMyAdmin<\/strong><\/em>.<\/li>\n<li>Search for the &#8220;correct&#8221; slug and replace it if required.<\/li>\n<li>Go to the Search:<br \/>\n<img class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2018\/03\/bsr3.png\" alt=\"\"\/><\/li>\n<li>Search for <em><strong>east-sussex<\/strong><\/em>:<br \/>\n<img class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2018\/03\/bsr4.png\" alt=\"\" \/><\/li>\n<li>Review the results:<br \/>\n<img class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2018\/03\/bsr5.png\" alt=\"\" \/><\/li>\n<li>Adjust if you like by double clicking the field and changing the slug:<br \/>\n<img class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2018\/03\/bsr6.png\" alt=\"\" \/><\/li>\n<\/ol>\n<h4>Using Better Search Replace<\/h4>\n<ol>\n<li>After installing the\u00a0<a href=\"https:\/\/wordpress.org\/plugins\/better-search-replace\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Better Search Replace<\/a>\u00a0plugin, go to <em><strong>Tools &gt; Better Search Replace<\/strong><\/em>:<br \/>\n<img class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2018\/03\/bsr1.png\" alt=\"\" \/><\/li>\n<li>Let&#8217;s now search for the slug that we want to replace:<br \/>\n<img class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2018\/03\/bsr7.png\" alt=\"\" \/><\/li>\n<li>You can now review where the slugs will be replaced:<br \/>\n<img class=\"greenborder\" src=\"https:\/\/wpgeodirectory.com\/docs\/wp-content\/uploads\/sites\/3\/2018\/03\/bsr8.png\" alt=\"\" \/><\/li>\n<li>If all is OK, run the process, but un-tick the &#8220;<em><strong>Run as dry run<\/strong><\/em>&#8221; box.<\/li>\n<li>Once that is done, re-save <em><strong>WP Settings &gt; Permalinks<\/strong><\/em>.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Better Search Replace\u00a0will assist with changing URLs or slugs etc in your database. It is also very helpful when changing your site from HTTP to HTTPS. Changing slugs that have -1 appended Sometimes when you add a new location or category etc, the slug [part URL] might get a \u201c-1\u201d appended. For example\u00a0mysite.com\/location\/east-sussex-1\/ This happens &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/wpgeodirectory.com\/docs\/better-search-replace-plugin\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Better Search Replace plugin&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1676,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[15],"tags":[],"amp_validity":null,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/posts\/23663"}],"collection":[{"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/users\/1676"}],"replies":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/comments?post=23663"}],"version-history":[{"count":0,"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/posts\/23663\/revisions"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/media?parent=23663"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/categories?post=23663"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/docs\/wp-json\/wp\/v2\/tags?post=23663"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}