Questions tagged [private]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
2answers
20 views

How to hide a page in wordpress made for menu

I'm trying to completely disable access to my parents page menu. For example, I have a menu made like this : parent page -> child page 1 -> child page 2 I made a real page for 'parent page' ...
3
votes
1answer
4k views

Redirect to login when on private page, and when logged in to specific page

I´m using a plugin called "private content login redirect". The plugin is actually only containing this piece of code: add_action('template_redirect', 'private_content_redirect_to_login', 9); ...
1
vote
1answer
2k views

Post visibility based on user role

How can I make it so that new posts will be automatically private, except visible to other users which have the same user role as the post author?
0
votes
1answer
38 views

How to set a Post's default visibility to 'Private' in Gutenberg?

I am trying to set a Post's default visibility to 'Private' when a user first creates the post. They should then have the ability to manually select 'published' from the sidebar dropdown once they are ...
8
votes
6answers
25k views

How do I require authorization / login to view a specific set of posts / pages?

I am working on a wordpress site for a client who wants an internal 'intranet' for his employees. The basic needs are: Communicate things in-house House important company documents Provide quick ...
1
vote
1answer
80 views

List all private pages user has access rights to read

I am trying to list all private pages that user has access to read. To explain in more details, below is the initial setup: Each user has a specific role created and assigned only ability to read ...
0
votes
0answers
10 views

Email 'Magic Link' to Access Content (not login)

I'm developing a site where users have their own 'profile' pages but which won't be public. I have a redirect in place currently which sends the visiting user away if not logged in (and not the owner)....
0
votes
3answers
266 views

How to remove private posts from RSS feeds?

Private posts are visible only to administrators and editors, but I have found that they are displayed publicly in RSS feeds. How can I remove them from there? I have this code but it doesn't work: ...
0
votes
1answer
949 views

Private pdf files

I would like to give access some private pdf files to only logged in users. I have this in my htaccess: RewriteCond %{REQUEST_FILENAME} ^.*(pdf)$ RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in.*$...
3
votes
4answers
3k views

Attach a private function at a hook?

I have a class with some private & public functions. The thing is that I don't want some of the functions to be able to be called outsite of the class, so I want to make them private. But I need ...
8
votes
5answers
26k views

How do I remove unwanted pages like archive, search, etc.?

By default WordPress pushes out a whole array of pages I don’t want or need - archive, author, blog, monthly, recent posts, categories, comments, attachment, taxenomies, search, search results, and ...
0
votes
2answers
21 views

How to hide a menu from public, but share content with a private link [closed]

I would like to create a menu or menu item that can only be seen with a private link. So the menu would house various pages, but the content can only be seen with a link that is shared. I have ...
0
votes
2answers
2k views

Prevent private post 404

I want private posts (for those not logged in) to use the single.php template just as public posts do, at the moment they get thrown over to the 404.php template. I've had a good look through the ...
6
votes
3answers
13k views

Set posts of a custom post type to be private by default?

Say I created a custom post type called 'Private Posts' ($post_type = itsme_private_posts) and want all posts under the custom post type to be set to 'Private' automatically when published i.e. by ...
0
votes
0answers
37 views

Filtering private Posts

i got a page wich contains only private posts. Is there a possibility to use the wordpress built-in filters like archive or category?
0
votes
1answer
50 views

Check the stored / cached WP_Query with transients on post change

right now I have WP_Query stored for 24h (1day) with set_transient function. Everything works fine like it should. But if for example I change the post which is in the stored array to private or ...
0
votes
1answer
30 views

Forcing two or more custom post type to be private

I registered a new custom post type and forced it to be private, but now I need to use three custom post type. I registered the second one, but I don't know hot to set the code to force the second one....
0
votes
3answers
3k views

What differences are there between a Privately Published post and a Draft post?

WordPress has three different post statuses: Published Pending Review Draft It also has three different visibility options: Public Password protected Private When you set a post to Published and ...
2
votes
2answers
9k views

How do I check if a post is private?

What I am looking to do is check if a page is private, give the users the option to register and see the page. Here is what I have now: <?php if (have_posts()) : /* Print the most as normal */ ...
0
votes
1answer
658 views

Accessing private posts through REST API, same code that works in remote doesn't in local

I am capable of fetching private posts through the wp rest api by calling mydomain/wp-json/wp/v2/posts?status=private&slug=whatever I am authenticating well and receiving a valid token, no ...
8
votes
3answers
3k views

How can I make it so the Add New Post page has Visibility set to Private by default?

I'm trying to create a plugin that alters the Add New Post page so the Visibility field says "Private" by default: Status: Draft Visibility: **Private** Publish immediately [Publish] ...as opposed ...
5
votes
0answers
2k views

Fetching private posts or custom post types via WP-API with basic authentication

I've installed WP-API along with Basic Auth. I'm able to fetch cpt posts using curl http://siteurl.com/posts?type={post-type} However, if I change a post to private, it is no longer returned. This ...
0
votes
0answers
15 views

Code correction - Hide a profile from visitors with a specific role

The following code i tried to hide the profile of subscriber's role of user not logged in but I need it to be visible to the administrator and shop_manager, how can I do it? add_action('bp_ready', '...
1
vote
1answer
992 views

Hide a template part when page is password protected?

I'd like to hide the sidebar of my page when the page is password protected and the password has not yet been entered. I've searched for a while and haven't found any condition I could use. Maybe ...
0
votes
0answers
43 views

Cannot see private content

I have put all my pages private check and now I cannot access the wp-admin. Does anyone know how I can fix this from the database or from the WordPress code? I'm the administrator.
0
votes
1answer
128 views

Will 'private' status prevent Woocommerce products to be indexed by search engines?

I'm currently disabling some Woocommerce product from my site and for this, I set them as private. I'd like to know if 'private' will also set the no index meta as true?
4
votes
5answers
6k views

Exclude Private, Draft pages from Primary Nav when using custom menu

I'm looking for ways to prevent "private" and "draft" pages from appearing (to non-logged-in admins) in a site's Primary Navigation menu which is based on a custom menu - other than manually removing ...
0
votes
1answer
395 views

Custom post type permalink returns 404 when set to private

I have a custom post type that is configured to use a permalink structure prepended with the post type name. When using get_permalink(), the URL that is returned does not include the post type name. ...
0
votes
1answer
20 views

How to block access to Crawlers to any Image on a Private page

We found out that a reverse image search on google images was able to link to a set of images that are on Private Pages. Is there a plugin that can fully protect these images? if not what coding ...
-1
votes
1answer
489 views

Exceeded the virtual memory limit

I've launched website a few weeks ago using WP. I've started getting messages from my web host saying "Your website.com web hosting account exceeded one or more of its resources within the last 12 ...
1
vote
0answers
416 views

Subscriber (with read permissions) cannot view Private posts

QUESTION: Why can't my Subscriber role (i.e. logged out user) view Private posts with the read_private_posts (or read_private_pages) capability extended to them? I use the Capability Manager Enhanced ...
0
votes
2answers
2k views

Custom get_the_password_form

I'm interested in creating a filter for pages with password protection and that have a certain category. I've placed this code in my theme's child folder in functions.php since I didn't want to edit ...
0
votes
1answer
21 views

Assign a username and password to specific users

We need a public section to our site and a private section. For the private section we would like to assign a username and password for each user that is NOT their Wordpress username/password. Is this ...
0
votes
1answer
136 views

Administrator cannot see private content

I have a WordPress site and I want to hide most of the content for awhile. I have changed the status of almost all posts to private but there is a problem. Although I am the administrator I cannot see ...
0
votes
1answer
29 views

Is there a way to load pages/site from specific referring source only?

I am trying to create a user manual for our software which would be stored on WordPress. But I don't want it accessible to just anyone, it should be hidden, at the very least not indexed by search ...
12
votes
1answer
16k views

simple solution for restricting access to (some) uploads/downloads

Initial Situation For a site I'm setting up I was looking into the whole field of securing uploads/downloads and restricting access to them based on user roles/capabilities. Of course I have read ...
1
vote
0answers
32 views

Show certain posts in a LIST format that members have been granted access to

I need post visibility control, but I don't want just "a class of users" to be able to see a post; I want just 2 or 3 users I specify to see a post. Then later, those same users will go on to view ...
0
votes
1answer
1k views

Private post hidden from Admin too

I have a strange problem. I am running a woocommerce site with several levels of privileges/roles. I wanted to reserve a group of products for specific users and was anticipating modifying the user ...
1
vote
0answers
53 views

Can't locate a hidden private page

I have 9 published page, and 1 private (invisible) page, in total 10 pages. However, my wordpress says that there are (2) private page, and total of (11) pages. How can I locate the unseen page?? FYI,...
1
vote
1answer
10k views

The best way to protect uploaded media in WordPress?

I'm new to WordPress as I normally code my stuff by hand, I've been uploading some media to display links to within protected pages, which is great, however, anyone can access the direct url of the ...
1
vote
1answer
2k views

Private page protected with username and password

We are building a WordPress site where one of the pages needs to be accessed via username and password. I know that I can create a "Private" page, where the user can enter a password to view. However,...
1
vote
2answers
1k views

My custom page template with is_user_logged_in() does not detect that I'm logged in

I have a custom page template that looks like this: <?php if( is_user_logged_in() ): ?> <?php get_header(); ?> <?php while ( have_posts() ) : the_post(); ?> <?php ...
1
vote
3answers
3k views

How to show just private posts in loop

I have a section in my website where i want to display just the private posts for logged in users, but the loop returns all posts (private and publish), is it possible to change this? I have the next ...
0
votes
1answer
968 views

read_private_pages capability not working for new role

I have created a new user role - vendor - with the capability to read_private_pages, but when I log in as such a user, and go to a private page I cannot see it. Here is my plugin code: function ...
1
vote
1answer
2k views

List Category Posts not showing posts marked private to logged-in users

I'm using the List Category Posts plugin, and it isn't listing posts marked private, even if the appropriate user is logged in. Is there a fix for this?
1
vote
1answer
42 views

How do i make my wordpress website private?

Ive seen other similar posts on here asking the same question but cannot seem to find an answer for my situation which is a bit more unique. I'm building a support website for a product we have and ...
1
vote
1answer
1k views

View Private Published Page with URL Code (no login required)

The goal is to easily allow for larger entities/clients to review content without having to have a user login/account for every project stack holder involved by providing a single URL to the final ...
12
votes
2answers
7k views

Where to securely store API keys and passwords in WordPress?

I'm looking to use a few APIs and many come with keys, secret keys and passwords required to work. Where in WordPress can you store that information? Assuming anyone can hack your DB is there anyway ...
1
vote
0answers
18 views

How to update the counter of private pages in the dashboard?

In my dashboard the counter of private pages shows 1, but the list of private pages is empty: Is there a way to recalculate the counters of pages and set them to the proper values?
1
vote
1answer
3k views

query private custom post type

My custom post type is registered with 'public' as false and I'm querying with a WP_Query() object. arg's 'post_type' set to private too. The url is site.com/?post_type=my_post_type I've tried to set ...