{"id":5350,"date":"2026-04-08T15:03:10","date_gmt":"2026-04-08T14:03:10","guid":{"rendered":"https:\/\/ibex.tech\/cloud\/?p=5350"},"modified":"2026-04-08T15:04:31","modified_gmt":"2026-04-08T14:04:31","slug":"clear-post-so-page-can-be-refreshed","status":"publish","type":"post","link":"https:\/\/ibex.tech\/cloud\/php\/forms\/clear-post-so-page-can-be-refreshed","title":{"rendered":"Clear POST so page can be refreshed"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Cause a reload of the page using JavaScript once you&#8217;ve handled the POST<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>    \/\/Redirect to same page to clear POST\n    echo '&lt;script&gt;window.location.replace(window.location.pathname + window.location.search);&lt;\/script&gt;';\n    return '';<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">This is the other way, but it won&#8217;t work correctly inside shortcodes etc<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>header('Location: ' . $_SERVER&#91;'REQUEST_URI']);\nexit;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Cause a reload of the page using JavaScript once you&#8217;ve handled the POST This is the other way, but it won&#8217;t work correctly inside shortcodes etc<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[346,42],"tags":[],"class_list":["post-5350","post","type-post","status-publish","format-standard","hentry","category-forms-wordpress","category-forms"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/5350","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/comments?post=5350"}],"version-history":[{"count":2,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/5350\/revisions"}],"predecessor-version":[{"id":5352,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/5350\/revisions\/5352"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/media?parent=5350"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/categories?post=5350"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/tags?post=5350"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}