Add this piece of code to your theme’s functions.php
file:
<?php
if (is_user_logged_in() && !is_page('YOUR PAGE SLUG') && empty($_SERVER['HTTP_REFERER'])) {
wp_safe_redirect( site_url('/members.php'));
exit;
}
?>
Assuming that your members.php
is located at http://example.com/members.php
. This will redirect any logged in users to that page.
Related Posts:
- How to let a single post have its own domain name
- Redirect members to custom page upon logging in through WP admin
- Redirect to requested page after (custom) login
- Hide Login information in Account settings in Buddy Boss
- Turn off redirect to canonical domain (or host website on any hostname)
- Search result page redirect ex.com/?s=searchterms to ex.com/searchterms
- How To Load an HTML File As A WordPress Page (With No 301/No Redirect)
- How do I create a root link in wordpress to a PDF file?
- Restrict content access to logged in users
- Showing different pages depending on a cookie value
- Block direct access to thank you pages
- Custom Route Returns 301/Passing Variable from Input
- Redirect Every Instance of The Author Template Pages to Custom Author Pages
- Allow arbitrary text after page URL
- Redirect all pages to the custom login page except for the registration page
- Redirection after Category Change for Custom Structure
- Multiple Inputs in a Customizer Control
- Embedding a SOAP Client into a WordPress Plugin?
- Remove WordPress theme from a specific page
- Backup the Database and Restore from the Backup?
- Scaling a WP eCommerce site
- How to keep a WordPress site synchronized between two servers?
- Limit Media Library to Given Folder
- difference between esc_attr(), strip_slashes(), strip_tags()?
- Converting primary keys from autoincrement integers to UUIDs
- Adding Custom Link anchors in the top menu that points to specific sections of the site home page
- TinyMCE default link target to “_blank”
- Friendica integration using wordpress authentication
- setting a specific home page for logged in users
- Page with several user editable text content
- Fast way to add countries as a custom taxonomy term?
- Programmatically add a custom page/path/url/route to WordPress
- Get multiple db prefix with $wpdb
- How do I remove the eye icon that shows visibility on login screen and reset password screen
- Passing page url into a custom field via the Press-This bookmarklet
- Using transients to store captchas
- How to extend nav-menu-item-control data in Appearance > Customize?
- Unique User Account Number + Displayed Via Shortcode
- Is it possible to have one page with multiple items, or 2 blogs on a site?
- Function to allow “Anyone can register”?
- Fatal error in wp-admin/customize.php after fresh install due to null $wp_customize
- Moving from development while pulling production database without overwriting, to production
- changing font size and font of a custom message added after comment
- wp_query get post custom taxonomy in search.php
- Custom wp-content and upload directory
- Lost password empty field error redirect to custom login
- Users can only view their content from the front end
- Localization: I want the backend: english and frontend in defined language
- WordPress Custom File Permalink
- Theme compression/ minifying or W3 Total Cache – which should I use? [closed]
- How to remove all the items under “Personal Options” on user profile page?
- Extend WordPress Core Classes in OOP Theme?
- how to display a specific wordpress menu?
- User bar above logotipo?
- Create a url structure for my blogs based on categories and sub-cats
- Can I integrate wordpress with my current website so I can utilize the wordpress plugins?
- Sticky menu for WP custom menubars
- More tag – how do I remove preceding ?
- Salesforce lead tracking with contact forms plugins [closed]
- How can style text like this in wordpress
- Setup database structure with books, authors, languages etc. for publishing house [closed]
- Dynamically Filtering Posts by Data Points – Any Pointers?
- Woocommerce custom checkout form
- Remove year from title
- How to remove admin menu pages inserted by plugins and themes in the top admin bar?
- WordPress custom dropdown listings
- Custom Tags Archive – permalinks not working
- Help customising admin bar, removing buddypress links from dropdown
- WordPress in a Subdirectory
- Change Site Logo or Menu Logo Per Page
- WP Search Form Query: Add Author’s posts into search query
- javascript file not working in a plugin template file
- If Term Name Exists, Append a Unique ID to Slug
- where is admin footer?
- How can I display both LTR and RTL language texts on the same page?
- New Page/Post Screen Opens an Existing Post
- Custom product status get filtered on all product list views
- URL issue after setting up Custom Structure in Settings >> Permalinks
- Add button to My Sites dashboard page (multisite)?
- Cannot go to next page on phone but can on computer
- A specific menu inside a page, load different contents without reloading it, under the same link
- How to hide or remove a custom widget area when empty
- Dockerized WordPress is having Nginx Proxy Issues
- Create single{custom}.php with data in table out of wp_posts
- Highlight specific user with custom field value
- How to define a static Home page
- let users add multiple divs in static page
- Best way to replace image url with source
- Multiple Taxonomies Using Custom SQL Query
- Changing starting number of User ID
- Logged in only custom page
- Make Terms Under Custom Taxonomy Use Specific Single.php Template
- How to duplicate “Pages” section in the control panel?
- Problem Locating and Changing Alt Attribute Of Link
- Pull certain WordPress posts on custom CMS instead and 301 wordpress to it?
- Adding css and js to a blank page created with custom template
- Create users via PHP
- Show post content in two different places without redirect
- Applying my own css classes in wp_menus 3?
- How can I make a search term redirect to a page