title: How to properly URL redirect in WordPress after form submission?
body: <p>How do I properly redirect after a form submission in WordPress? I truly have searched for it all over the place and have not yet found an answer to this. I think a good explanation to this question might benefit many.</p>
  
  <p>In my case, I have a form that submits to itself, if the form validates, the data is saved and the user should be redirected. In case it fails, the user should see an error or be redirected depending on the nature of the error.</p>
  
  <p>After researching, the most proper way seems to be to use the function <code>wp_redirect()</code>, but I can't get it to work. I know why, because the header has already been sent out ( meaning, browser has started to output and can't redirect). I got that part. But then, how do I use this function properly? I can't wrap my head around this one.</p>
  
  <p>I tried using the good old <code>header(Location: http://www.example.com/);</code> response. No luck with that either.</p>
  
  <p>Can anyone elaborate on this? Thanks.</p>