Set your posts/pages as “password protected”. In the Publish box when editing/creating a post, change the visibility from public to password protected
UPDATE
You’ll need to use some rewrite rules to redirect everything to the root URL. The first condition redirects everything to the root URL, the second condition adds exceptions for images, css, javascript and for the wp-admin folder. Add this to your .htaccess
file
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L,NE]
RewriteCond %{REQUEST_URI} !\.(?:jpe?g|gif|bmp|png|tiff|css|js)$ [NC]
RewriteRule !^wp-admin / [L,NC,R=302]
Related Posts:
- get_template_directory_uri pointing to parent theme not child theme
- How to add a data attribute to a WordPress menu item
- Functions.php code that only runs on localhost?
- hook a functions to change wp-config from functions.php
- Relative URLs and hide /wp-content/themes/
- Shared functions.php across multiple WordPress websites
- How to restrict actions and filters “properly” by conditions
- Extending auth_cookie_expiration based on user role
- Check if the user has explicitly set an excerpt
- Slugs as breadcrumbs for Pages
- Add inline css to theme
- Shortcode with custom content attribute?
- Add a Post Thumbnail to an RSS Feed with custom size
- Automatically add author’s name to post_tag
- Print Dashboard menu name and link
- Remove_filter (‘the_content’, ‘wpautop’) is not working
- Develop function get_template_part in functions.php
- Change comment_reply_link URL
- Ajaxing function in widget class
- Super simple shortcode not working
- WordPress function for 1 to for many
- Using “Read More” link with custom excerpt
- How can you limit srcset on a single type of page?
- How to fix Warning: call_user_func_array()?
- what function can I use to automatically output og tags per page/post?
- Add error message on password protected page ONLY when password introduced was incorrect
- Select pages by category
- wp_register_script(… $in_footer = true) not working
- I want to get product attirbute in the section below
- Restore Image Title Text
- Output and filter data from a XML url
- Where to start learning more about wordpress templates [closed]
- What did I do wrong in my functions code, that will not change the “Get New Password” text to “Send It”?
- How do I create a function that simulate the click on Update button for all posts?
- Multisite Ajax serialize return error [object Object]
- Full page template function
- Redirect from “private” page and functions.php which tag add to add_action()?
- PHP mixed with some JS code to update WordPress theme settings
- Display gallery on bottom after content
- What does this code do? (Injected code hacked)
- Wp admin – Set default value to 999 in comments
- WordPress listen to $_POST in functions.php
- wordpress use single ajax in place of multiple ajax requests in a smarter way
- Add Element as a Filter to the_content
- Can’t properly set the_title add_filter to show short_URL
- WordPress function, Run using Crontab
- Check if the image size is available and if not use ‘full’ image size
- Infinite counting in WordPress
- Tags break custom Excerpt function
- Using $WPDB to create simple array to check against user entered value
- Create custom function for hero image
- Can set_post_thumbnail be used to remove a thumbnail?
- issue with if/elseif in_array inside foreach loop display only one post
- Specify multiple categories for custom post template – FATAL ERROR
- Fail to get the total number of posts
- Call two different function.js depending on page
- Display a random tag but using cron to control frequency of change
- How to conditionally add a widget via a hook in functions.php
- Unescape attribute the_title() on CDATA in RSS feed
- resizing of thumbnails not working
- How Do I include/Import a Custom Widget from the Parent theme into My Child Theme?
- Changing date query from month
- Need To Resize Images Exactly Without Losing Image Details
- How to add or delete default value theme options while activate and deactivate theme
- Warning at top of website & top menu gone
- the_date() and the_time() functions display actual date an time instead of published date and time
- Pass URL to iframe in WordPress Block
- How do I make the comment disappear after deleting from the database?
- Can’t load assets
- Delete oldest wordpress post (SQL query)
- External api call and make global variable for any page visitor enters , page-home, page, single etc
- WP AJAX Request Not Working
- Competing Login Redirects – Need to be Combined?
- Warning and fatal error
- How to add styles in existing function?
- Altering page / category names in breadcumbs
- Featured image on archive page based on post type
- Including admin-options.php file in Child Themes
- Adding an IF ELSE to a function
- wordpress ajax is not working for dropdown selection
- Providing fallback function and allow override by plugin
- is_page_template wont allow me to enqueue scripts
- Pagination in Search result
- Custom field not updating via functions upon publishing
- disable WP_error: authentication_failed
- Load a Child Theme’s style.css just before the closing tag
- Can’t wrap my head around this function – any help would be appreciated
- Figure inlined width trigger distorted layout
- Create input select image URL?
- Exclude javascript in certain page url and all following url’s after forward slash
- Including one page with WordPress functions into another
- Dynamically Generating User Meta Field
- Changing functions.php and .htaccess files
- Shortcode Variations?
- Code in functions.php appearing on front-end and dashboard [closed]
- How to test for a class (from a plugin) in functions.php
- Child Theme not working – CSS gone
- Sessions in word press [duplicate]
- “woocommerce_output_related_products” not working
- woocommerce_sort_product_tabs() expects an array