WordPress.org

Support

Support » How-To and Troubleshooting » Comment out code in WP?

Comment out code in WP?

  • How do I comment out code in my index.php file? I don’t want to delete certain things in case I want to use them again, but that’s standard.
    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • If you are trying to comment out PHP code, you can surround it with /* and */ or if it’s a single line you can use //.
    If you are trying to comment out HTML code that is outside the <?php and ?> markers, then you can use the standard HTML commenting mechansim of <!– and //–>.
    Regards

    TechGnome

    @techgnome

    Moderator

    Maybe you need to adjust your occular data input port. I can see cypher’s stuff just fine. I’d like to note something though. What cypher suggested is commenting out PHP code, which will not affect any intervening HTML code. Conversely, what kafkaesqui suggested will only comment out HTML, but the PHP will still run – it will simply get commented out and not displayed (but it will be sene if yo uright-click and view source.
    TG

    *rubs eyes*
    Nope. Ain’t helping…

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Comment out code in WP?’ is closed to new replies.
Skip to toolbar