Recently, a question came up of how to deny P.O. Boxes in a WooCommerce installation – something not built in by default, but certainly useful for a lot of companies. Naturally I hit up the Googles, but a lot of the codes and functions were outdated – below, I’ve included a snippet you can add to your
functions.php file that fixes the issue.
Note: Be sure to not include the opening
<?php on line one OR the closing
?> on Line 29 – those are for code styling purposes only.
Alternatively, I made a quick plugin that does the same thing – upload the .zip to your site or copy the .php file to your
plugins folder – click the button to get started.
Update: December 29, 2016 There is a different way to add code than adding it directly to your
functions.php sheet – see the guide here for more information.
Have any questions or comments about this article, or ways you think it can be improved?
Join the conversation in the comments below, or sign up for my newsletter to recieve periodic updates!