Site logo

Archived topic

Make some pages content accessible via API but not directly

3 replies · Started by John on October 8, 2022

Viewing posts 1–4 of 4

I have some pages with several custom fields that I use to pull data from via dynamic data. However I don't want users to be able to access these pages directly (they are not meant to be seen on their own, it's mostly meta data).

Is it possible to block access to certain pages, while still allowing other pages to pull data from them via dynamic data?

Hi John,

If you set the Post/Page to draft, you should still be able to grab its Post Meta data on other pages.

In this way, users won't be able to access your Post/Page.

Thanks Fernando, that's brilliant!

I had tried that before and the page wasn't included in the Query Loop. But it dawned on me after your message that there might be a setting in the Query Loop, and there is. For anyone looking for it in the future, just click Add Parameter and choose Post Status.

I didn't really want to show all my draft pages, so instead I chose to set those "hidden" pages as Pending Review and pull that in the loop.

Thanks for putting me in the right direction

I see. Glad you got it working! You're welcome John!

This archived topic is closed to new replies.