 <p>Use <a href="http://codex.wordpress.org/Function_Reference/is_page" rel="nofollow"><code>is_page</code></a> to detect your front-end login and registration pages:</p> <pre><code>&lt;?php if ( ! is_user_logged_in() &amp;&amp; ! ( is_page( 'register' ) || is_page( 'login' ) ) ) { echo '&lt;div&gt;Some stuff here&lt;/div&gt;'; // your code } ?&gt; </code></pre>