avatar Deluxe Blog Tips About Projects

Display Blog Rules In Register Page In WordPress

Display Blog Rules Register Page WordPress

In a forum, everybody must read the forum rules and accept it before registering. That is useful because it helps members to understand how the forum works. The idea, of course, can be applied to WordPress blog, too. We can display the blog rules or just the welcome text in the register page by using simple code as the following direction.

Open the functions.php file of your theme and paste this code into it:

add_action('register_form', 'my_rules');
function my_rules() {
    $html = '
        <div style="margin:10px 0;border:1px solid #ccc;padding:10px">
            <p style="margin:5px 0;font-weight:bold">By registering in ABC Blog, you must accept the following rules:</p>
            <p style="margin:5px 0">- Use the real email address that blog admins can contact you at anytime</p>
            <p style="margin:5px 0">- Don't post pornographic materials, unlisenced softwares, etc.</p>
        </div>
        ';
    echo $html;
}

You can see the result in the screenshot above. The code is self explained as it is, it just displays raw HTML string.

One disadvantage of this method is that it displays the text inside the register form, there is not much space for echoing strings as in the forum's situation. So be brief and creative using it!

🔥 HOT: Interested in boosting your WordPress SEO? My Slim SEO plugin is a super lighweight and automated plugin that handles most the hard work for you: meta tags, sitemap, redirection, schema & link building.

👉 Have a look and you will love it: wpslimseo.com

Comments