• Blog
  • Contact
    • DE
    • EN
    • FR
SaaS Web Internet Solutions
  • Services
    • Planning
      • Consulting and ConceptionPlan independently, from idea to concept
      • Website RelaunchA new design without losing content or visibility
    • Content & Marketing
      • Copy, Content & Landing PagesContent that gets visitors to act
      • Online MarketingGet found with SEO, SEA and social media
    • Development & Operations
      • Custom DevelopmentWeb applications instead of bent standard software
      • Managed HostingServers, updates, backups and monitoring
      • Service & Support After Go-LiveMaintenance, further development and quick help
    Start a projectFrom idea to operation, all from one sourceTell us what you have in mind – we’ll get back to you with a first proposal.Arrange a call
    From Karlsruhe since 2009 – for businesses across Baden-Württemberg and beyondAll services at a glance
  • Software & development
    • Technologies & FrameworksSoftware and technologies as the basis for your project
      • Craft CMSContent management for demanding websites
      • Ruby on RailsCustom web applications and their operation
      • WordPressWebsites, shops and support since 2011
    • Software for MunicipalitiesDigital solutions for municipalities, administration and citizen services
      • The Vacation Platform for MunicipalitiesBook and manage holiday programmes online
      • Citizen Discount ProgramApply for passes and discounts online
      • Management of After-School Care for Elementary School ChildrenRegistration and place allocation for schoolchildren
    • Use of AIHow we use AI in our daily work
    Software for municipalitiesIn productive use since 2016Holiday programmes, discount passes and after-school care – in Karlsruhe, Mannheim and elsewhere.View solutions
    Our own software and technologies, proven in real projectsTo our toolbox
  • The Agency
    • The teamPassionately developing web projects since 2009
      • About UsWho we are and how we work
    • BlogProjects, news and tips
    From the blog · October 2026Security Advisory: PHP Vulnerabilities CVE-2026-109618, CVE-2026-109619, and CVE-2026-115560 (“PHP2Shell”)Read post
    SaaS Web office · Steinstraße 25 · 76133 Karlsruhe, GermanyGet in touch
  • Talk to usBlog
    • Deutsch
    • English
    • Français
    0721 18039510info@saasweb.netSteinstraße 25, 76133 Karlsruhe, Germany
    Office hours Mon–Fri 9:30 am–6:30 pm
  1. Home
  2. Blog
  3. WordPress: How to Create a Private Homepage for Family and Friends

Tutorial

WordPress: How to Create a Private Homepage for Family and Friends

21. July 2017 · 8 minute read

This post is from July 2017. The screenshots show the interface as it was then; today it looks slightly different in places.

In a private setting, it is not uncommon to want to avoid sharing photos, videos, and texts with everyone.

However, you still want to be able to share content with friends and family, and it should be simple (plus, they shouldn’t be given permissions to modify the homepage)… Many people therefore prefer to use Facebook because they believe the content is private there—well, let’s leave comments on that aside…

Let’s turn to another option: we create a WordPress homepage that only registered users can access. To ensure that not everyone has to remember a login and password, we offer the option to log in via Facebook Login in addition to the standard registration.

Procedure

How do we achieve our goal?

  • Restricting Access
    • Set up the Members plugin to adjust WordPress role definitions and redirect access to the homepage via the login page
    • Install the User Role Editor plugin to create a custom capability (permission)
    • Adjust the theme’s functions.php file to hide homepage content from subscribers
    • Create a page with information for logged-in users who do not have the appropriate permissions
  • Install/configure a Facebook plugin to allow Facebook users to log in without a username/password
    • Create a Facebook app
    • Set up a social login plugin (Nextend Social Login)

Restricting Access to the Homepage

Members Plugin Settings in WordPress

Setting Up the Members Plugin

The Members Plugin serves two functions for our use case:

  1. Preventing general access to content: visitors must be logged in
  2. Creating a new “Family & Friends” role: as an admin, we can manually move subscribers (who have no permissions) into the new role

We install the Members plugin and take care of its settings:

  • Enable Private Site: check this—we want only logged-in users to be able to see the content, so non-logged-in users should be redirected to the login page, regardless of which page they try to access
  • REST API: check this—otherwise, posts and pages can still be retrieved without logging in via the /wp-json/ interface
  • Disable Feed: check this—other people or services should not receive information about the content

The other default parameters can remain as they are.

User Role Editor: Creating a New Capability

Creating a Custom Capability

The User Role Editor plugin is a popular and free plugin for editing WordPress users and user roles. For our project, we will create a new capability and use it to check whether the visitor has this permission or not. The query regarding whether they are authorized or not follows in the next paragraph concerning functions.php.

So, we create a capability named oooooxooooo and assign it to the “Family & Friends” role, as well as the Admin role. If other roles are occupied on the WordPress installation (Editor, etc.), you can also assign the capability to those roles. In any case, DO NOT assign it to the “Subscriber” role!

Additional Setting in functions.php

Unfortunately, the Members plugin is not sufficient for our project, or rather, it is somewhat cumbersome. The Members plugin only enforces that visitors must log in. By default, however, a logged-in user has access to all content (pages/posts). But even if you set user permissions for all pages and posts, the unauthorized visitor will still see, for example, the post titles; only the content itself is blocked.

That is not what we want; we want to block access completely.

To ensure that unauthorized visitors are redirected to a page containing information, for example, on why access is prohibited, we add additional code to the theme’s functions.php (ideally in a child theme; otherwise, the code will be lost during the next theme update). Brief explanations:

  • Every theme has a functions.php. This central file controls the behavior of a theme and connects various files together
  • The additional code checks three things:
    • whether the visitor is logged in,
    • whether the visitor does not have the “oooooxooooo” capability
    • and whether the user is not already on the “Stop” page

    If all three conditions are met, the visitor is redirected to the “Stop” page; otherwise, the visitor can view the pages/posts. The third condition is important because if someone accesses the “Stop” page, no further redirection must occur; otherwise, the request turns into an infinite loop.

Code for functions.php

function my_page_template_redirect(){
  if( is_user_logged_in() && ! current_user_can( 'oooooxooooo' ) && ! is_page( 'stop' ) ){
    wp_redirect( home_url( '/stop/' ) );
    exit();
  }
}
add_action( 'template_redirect', 'my_page_template_redirect' );

Code for functions.php in Multisite

function my_page_template_redirect(){
  if( is_user_logged_in() && ! current_user_can_for_site( get_current_blog_id(), 'oooooxooooo' ) && ! is_page( 'stop' ) ){
    wp_redirect( home_url( '/stop/' ) );
    exit();
  }
}
add_action( 'template_redirect', 'my_page_template_redirect' );

Page with Info for Rejected Users

Visitors who log in but do not have the required permissions should not simply see a blank page or some error message. It is much better to show these individuals a page stating that they do not have permission and should contact the homepage operator if necessary. An additional note for Facebook users who are using the Facebook login for the first time and therefore do not have permission is also useful.

Facebook Login

To ensure that you, as the homepage operator, do not have to create all your acquaintances first—who would certainly find it difficult to remember the login data—we install a Facebook login function. As you have probably seen before, on the homepage’s login page, next to the input fields for username and password, there is a button labeled “Connect with Facebook” or something similar.

Regardless of which Facebook login plugin is used, we need a Facebook app that the plugin can connect to when a Facebook user wants to log in.

As of 2026: Meta now places significantly higher requirements on such apps (HTTPS, privacy and data deletion pages, and usually business verification and app review for users outside the app). For a private family homepage, Google Login, which the plugin mentioned below also provides for free, is often the easier path.

Facebook App Settings for Login

Creating a Facebook App

To create a Facebook app, log in here: https://developers.facebook.com. Naturally, you must have Facebook login credentials; otherwise, you must register.

  • Create a new app: App Name + Contact Email, select “Facebook Login” as the use case
  • Customize Facebook Login: Add the “email” permission and enter the valid OAuth redirect URI displayed by the plugin (the website must be accessible via HTTPS)
  • Settings > General: Enter App Domain, Privacy Policy URL, Terms of Service URL, and Data Deletion Instructions URL, Category, and App Icon; Add Platform -> Website -> Enter URL (save)
  • To ensure that not only people with a role in the app can log in: go through business verification and app review, then switch the app from development mode to “Live”
  • Copy the App ID and App Secret and paste them into WP

Setting Up Nextend Social Login

We are now using Nextend Social Login as the plugin (as of 2026; the “WordPress Social Login” plugin previously recommended here was closed in 2023 due to a security vulnerability on wordpress.org): the basic version of the plugin is free and can connect Google and X (formerly Twitter) in addition to Facebook; other networks are available in the Pro version.

To make the plugin do what we want, we need to configure the following:

  1. Copy data from the Facebook app and enter it into the plugin
  2. Registrations and logins should be allowed (in Nextend: General > Membership > Enabled)
  3. Users connecting via networks initially receive the “Subscriber” role—this is the default role for new users, which we check again under Settings > General just to be safe: better safe than sorry!

When a new Facebook user registers, we also want to be informed so we can change the permissions (or not, if they are not desired individuals). Nextend sends the standard WordPress notification for new registrations by default, so the admin receives an email. In the Pro version, “Admin” alone can be selected under Registration notification sent to.

Insert Facebook App Data

WP Social Login: Insert Facebook App Data

General Settings

WP Social Login: General Settings

Permissions for New Logins

WP Social Login: Permissions for New Logins

Optional: Remove Admin Bar

If you want users from the “Family & Friends” group or those who are not admins (or do not have admin permissions) to not see the admin bar, you can hide it accordingly. To do this, code is again added to the functions.php:

function remove_admin_bar() {
if( ! current_user_can('manage_options') && ! is_admin() ){
show_admin_bar(false);
}
}
add_action('after_setup_theme', 'remove_admin_bar');

Note: this naturally means that these users cannot easily access their profile and therefore cannot edit their own data. However, we can add an entry to a suitable menu, e.g., “Edit Profile,” which links to https://my-website.tld/wp-admin/profile.php.

Summary

We have modified an existing homepage so that content can only be seen after logging in—provided the permissions are correct.

Logging in alone is not enough; the visitor must not belong to the Subscriber group (which is the default role when users are created) and must possess an additional oooooxooooo capability. Unauthorized visitors are redirected to the “Stop” page.

In addition to all this, we have set up a “Facebook Connector”: Facebook users can log in without entering a username and password. Newly registered Facebook users automatically belong to the Subscriber group and are initially not allowed to see anything. Note: if the visitor uses an ad blocker, the Facebook login may fail.

As the administrator, I am automatically informed of new registrations: if I know the Facebook user, I assign them the “Family & Friends” role.

Are you planning a new website? We develop WordPress websites that you can maintain yourself. More about WordPress websites

  • #App ID
  • #Capability
  • #Facebook App
  • #Facebook Login
  • #functions.php
  • #Hook
  • #Member
  • #Members
  • #Permission
  • #Subscriber
  • #User role
  • #User Role Editor
  • #WordPress
  • #WordPress Login
  • #WordPress Multisite
  • #WordPress Registration
  • #WordPress Social Login

Published on 21. July 2017, last updated on 27. October 2026

Older post WordPress: Creating Contact Forms with an Optional Copy for the Sender Newer post WordPress: Share Posts or Pages with Facebook or Twitter – Privacy Compliant

Read more

More from the blog

All posts

Programming March 2023

DIVI Theme: Changing the Reply-To of the Contact Form Module

Read more

Tutorial May 2018

GDPR-Compliant Contact Form with Gravity Forms

Read more

SaaS Web Info April 2018

WordPress and WooCommerce – The Perfect Duo

Read more

Our toolbox

Technologies & tools we work with every day

More about our technologies
  • npm
  • vtiger
  • ElasticSearch
  • Mastodon
  • Composer
  • Yarn
  • Contao
  • osTicket
  • PHP
  • Solr
  • GitLab
  • Ubuntu
  • Icinga
  • Nextcloud
  • MediaWiki
  • Vue
  • node
  • Meilisearch
  • Zammad
  • Kirby
  • Capistrano
  • Wekan
  • Angular
  • HTML5
  • Matomo
  • OpenProject
  • SOGo
  • openstack
  • Foswiki
  • WordPress
  • TYPO3
  • Ruby on Rails

The agency

SaaS Web office
Steinstraße 25
76133 Karlsruhe

Office hours:
Mon–Fri 9.30 – 18.30

  • About Us
  • Blog
  • Terms and Conditions
  • Legal Notice
  • Privacy Policy

Services

  • Services
    • Planning
      • Consulting and Conception
      • Website Relaunch
    • Content & Marketing
      • Copy, Content & Landing Pages
      • Online Marketing
    • Development & Operations
      • Custom Development
      • Managed Hosting
      • Service & Support After Go-Live
  • Software & development
    • Technologies & Frameworks
      • Craft CMS
      • Ruby on Rails
      • WordPress
        • WordPress Websites
        • WordPress Development
        • WordPress Stores
        • WordPress Support
    • Software for Municipalities
      • The Vacation Platform for Municipalities
      • Citizen Discount Program
      • Management of After-School Care for Elementary School Children
    • Use of AI
  • The Agency
    • The team
      • About Us
    • Blog

Software & development

  • Services
    • Planning
      • Consulting and Conception
      • Website Relaunch
    • Content & Marketing
      • Copy, Content & Landing Pages
      • Online Marketing
    • Development & Operations
      • Custom Development
      • Managed Hosting
      • Service & Support After Go-Live
  • Software & development
    • Technologies & Frameworks
      • Craft CMS
      • Ruby on Rails
      • WordPress
        • WordPress Websites
        • WordPress Development
        • WordPress Stores
        • WordPress Support
    • Software for Municipalities
      • The Vacation Platform for Municipalities
      • Citizen Discount Program
      • Management of After-School Care for Elementary School Children
    • Use of AI
  • The Agency
    • The team
      • About Us
    • Blog
  • Deutsch
  • English
  • Français