Yes, there are plumbing codes and regulations that dictate the proper installation and usage of P-traps. These codes vary by location, so it is essential to consult the local building authority or a licensed plumber to ensure compliance.