WordPress.org

Ready to get started?Download WordPress

Forums

restrict specified posts to IP address (2 posts)

  1. ergbot
    Member
    Posted 5 years ago #

    Is it possible to restrict specified articles/posts to a certain IP address? We'd like to set certain articles to only be viewable from inside the office, but these posts would not be viewable from anyone accessing the blog outside the office. Our goal is to use the blog to mix private internal posts with our standard public postings without any hassles of password restrictions. Any thoughts are greatly appreciated.

  2. pmdci
    Member
    Posted 5 years ago #

    Actually I am also intereste din doing something similar. I think the best way would be to do a IF statement in the THEME template files. You could then remove a given category from the post loop based on the IP address...

    For example:

    a) create a new category. Let´s call it PRIVATE
    b) in my site, the BLOG posts only appear under a specific page, called BOG (www.example.com/blog). I make sure that the posts for the category PRIVATE are not displayed when seeing this template.
    c) create a new template, like the one for the page "blog", and make sure that the page only output posts from the category PRIVATE. On the begining of this template, you could include an IF statement thaqt checks for the IP address.

    Any thoughts on this?

Topic Closed

This topic has been closed to new replies.

About this Topic