Looking at a Bricks made site, and by extending ?post_type=bricks_template, I can access all the template saved. How do I disable this?
I tested it in my site and found itās true. How to prevent it?
@Matej any thoughts on that? Sorry for mentioning here.
Have you tried Disabling public access to your Templates? Bricks Settings - Template tab - public templates
Confirmed. I have a private site with all my templates and Bricks settings show āPublic Templatesā setting is disabled. Still can see a poorly formatted template grid list with template name and creation date, even tho Iām not logged in and even with a private window.
Not good!
Redirect the URL using the Fluent Snippets or another snippets plugin!
How to use the Fluent Snippets plugin?
- Log in to the WordPress admin dashboard.
- Navigate to Fluent Snippets > Add New.
- Enter the name of the snippet, for example: āBricks Template Redirectā.
- Paste the following code into the snippet editor. Replace the YOUR DOMAIN / URL section with your own URL!
add_action(ātemplate_redirectā, function() {
if (isset($_GET[āpost_typeā]) && $_GET[āpost_typeā] === ābricks_templateā) {
wp_redirect(āhttps://YOUR DOMAIN / URLā, 301);
exit;
}
});
- Configure the following settings:
Scope: Choose whether the snippet should run in the admin area, on the front-end, or both. In this case, select Front-end.
Activation:** Enable the snippet. - Save and activate:
Click the āSaveā and āActivateā button.
Your code may work, didnāt test yet. But it supposes to work by default. Shouldnāt Bricks team look at it?
thank you but this seems like a bandaid solution. is there a way to configure this within bricks?
Pretty sure the āPublic Templatesā is only for viewing within the template library. Vs frontend. Could be wrongā¦
None the less, it should be hidden for sure on the front end. It does make sense that its not, considering its just a custom post type.
Also, i have implemented the action above and it works perfect! (just check the code when pastingā¦need to replace the accent characters (ā) with apostrophes (').)
