I worked on my site to post private messages on my site. I have created a custom publication status for this purpose.
My goal is to exclude messages belonging to this status from search, blog page, WordPress requests, RSS feed, etc. In principle, it should not be mentioned anywhere on the site.
So far it sounds simple, but the problem is that I WANT people to be able to see the message via a direct link.
Basically, I want it not to be mentioned throughout my site, but if someone visits it from a direct link, they can see it.
register_post_status( 'privatised', array( 'label' => _x( 'Privately Published', array('post', 'download')),
'public' => false,
'exclude_from_search' => true,
'show_in_admin_all_list' => true,
'show_in_admin_status_list' => true,
'label_count' => _n_noop( 'Privately Published (%s)', 'Aggregated (%s)' ),
add_action( 'init', 'custom_post_status' );
Here, if you see in the table, the first option is public, and I set it to false, which basically guarantees that my post is not there on my blog page, or research, or taxonomy page, or RSS FEED etc. Etc. But if I open the same message via its direct URL, it gives a 404, because not found …
Please help me, my message is only visible by the direct link of it.
As a sidenote, is it possible that I can make it public, then exclude it from taxonomy and everything, as I can do with exclude from research …