I've developed a series of plugins which can display categorised custom post types via shortcodes, along the lines of:

[myshortcode myshortcodegroup="groupname"]

This works just fine, however, I only want the custom content to be displayed via the use of a shortcode.

In other words, the content should NOT be accessible via slug/post-name.

  • Please edit your question and add the code you use to register your post type. – Milo Mar 16 '16 at 15:50

This is most likely a matter of configuring CPT registrations. register_post_type() has a lot of arguments related to visibility and access.

On top of my head to prevent CPT from having front-end links and queries you would want to set publicly_queryable to false.

  • Of course - forget that bit! In actual fact, all I needed to do was to remove 'public' => 'true' from the plugin registration defaults. Thanks. – Matthew Trow Mar 17 '16 at 8:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.