Skip to main content
replaced http://wordpress.stackexchange.com/ with https://wordpress.stackexchange.com/
Source Link

If you just want to "turn off" the public facing part of a taxonomy (eg. just use it for grouping), you can do that when you register it.

Just set the query_var argument to false and WordPress will not recognize taxonomy page requests and simply 404. This will work if you don't have pretty permalinks enabled.

<?php
add_action('init', 'wpse94193_register');
function wpse94193_register()
{
    register_taxonomy('your_taxonomy', 'your_post_type', array(
        // other stuff here...
        'query_var' => false,
    ));
}

You can also disable pretty permalinks by setting the rewrite argument to false (props ottootto).

<?php
add_action('init', 'wpse94193_register');
function wpse94193_register()
{
    register_taxonomy('your_taxonomy', 'your_post_type', array(
        // other stuff here...
        'rewrite'   => false,
        'query_var' => false,
    ));
}

If you do need to allow logged in users to view the taxonomy pages (can't tell from the question), that's different story.

If you just want to "turn off" the public facing part of a taxonomy (eg. just use it for grouping), you can do that when you register it.

Just set the query_var argument to false and WordPress will not recognize taxonomy page requests and simply 404. This will work if you don't have pretty permalinks enabled.

<?php
add_action('init', 'wpse94193_register');
function wpse94193_register()
{
    register_taxonomy('your_taxonomy', 'your_post_type', array(
        // other stuff here...
        'query_var' => false,
    ));
}

You can also disable pretty permalinks by setting the rewrite argument to false (props otto).

<?php
add_action('init', 'wpse94193_register');
function wpse94193_register()
{
    register_taxonomy('your_taxonomy', 'your_post_type', array(
        // other stuff here...
        'rewrite'   => false,
        'query_var' => false,
    ));
}

If you do need to allow logged in users to view the taxonomy pages (can't tell from the question), that's different story.

If you just want to "turn off" the public facing part of a taxonomy (eg. just use it for grouping), you can do that when you register it.

Just set the query_var argument to false and WordPress will not recognize taxonomy page requests and simply 404. This will work if you don't have pretty permalinks enabled.

<?php
add_action('init', 'wpse94193_register');
function wpse94193_register()
{
    register_taxonomy('your_taxonomy', 'your_post_type', array(
        // other stuff here...
        'query_var' => false,
    ));
}

You can also disable pretty permalinks by setting the rewrite argument to false (props otto).

<?php
add_action('init', 'wpse94193_register');
function wpse94193_register()
{
    register_taxonomy('your_taxonomy', 'your_post_type', array(
        // other stuff here...
        'rewrite'   => false,
        'query_var' => false,
    ));
}

If you do need to allow logged in users to view the taxonomy pages (can't tell from the question), that's different story.

Mention the rewrite argument.
Source Link
chrisguitarguy
  • 21.5k
  • 5
  • 62
  • 99

If you just want to "turn off" the public facing part of a taxonomy (eg. just use it for grouping), you can do that when you register it.

Just set the query_var argument to false and WordPress will not recognize taxonomy page requests and simply 404. This will work if you don't have pretty permalinks enabled.

<?php
add_action('init', 'wpse94193_register');
function wpse94193_register()
{
    register_taxonomy('your_taxonomy', 'your_post_type', array(
        // other stuff here...
        'query_var' => false,
    ));
}

You can also disable pretty permalinks by setting the rewrite argument to false (props otto).

<?php
add_action('init', 'wpse94193_register');
function wpse94193_register()
{
    register_taxonomy('your_taxonomy', 'your_post_type', array(
        // other stuff here...
        'rewrite'   => false,
        'query_var' => false,
    ));
}

If you do need to allow logged in users to view the taxonomy pages (can't tell from the question), that's different story.

If you just want to "turn off" the public facing part of a taxonomy (eg. just use it for grouping), you can do that when you register it.

Just set the query_var argument to false and WordPress will not recognize taxonomy page requests and simply 404.

<?php
add_action('init', 'wpse94193_register');
function wpse94193_register()
{
    register_taxonomy('your_taxonomy', 'your_post_type', array(
        // other stuff here...
        'query_var' => false,
    ));
}

If you do need to allow logged in users to view the taxonomy pages (can't tell from the question), that's different story.

If you just want to "turn off" the public facing part of a taxonomy (eg. just use it for grouping), you can do that when you register it.

Just set the query_var argument to false and WordPress will not recognize taxonomy page requests and simply 404. This will work if you don't have pretty permalinks enabled.

<?php
add_action('init', 'wpse94193_register');
function wpse94193_register()
{
    register_taxonomy('your_taxonomy', 'your_post_type', array(
        // other stuff here...
        'query_var' => false,
    ));
}

You can also disable pretty permalinks by setting the rewrite argument to false (props otto).

<?php
add_action('init', 'wpse94193_register');
function wpse94193_register()
{
    register_taxonomy('your_taxonomy', 'your_post_type', array(
        // other stuff here...
        'rewrite'   => false,
        'query_var' => false,
    ));
}

If you do need to allow logged in users to view the taxonomy pages (can't tell from the question), that's different story.

deleted 1 characters in body
Source Link
chrisguitarguy
  • 21.5k
  • 5
  • 62
  • 99

If you just want to "turn off" the public facing part of a taxonomy (eg. just use it fromfor grouping), you can do that when you register it.

Just set the query_var argument to false and WordPress will not recognize taxonomy page requests and simply 404.

<?php
add_action('init', 'wpse94193_register');
function wpse94193_register()
{
    register_taxonomy('your_taxonomy', 'your_post_type', array(
        // other stuff here...
        'query_var' => false,
    ));
}

If you do need to allow logged in users to view the taxonomy pages (can't tell from the question), that's different story.

If you just want to "turn off" the public facing part of a taxonomy (eg. just use it from grouping), you can do that when you register it.

Just set the query_var argument to false and WordPress will not recognize taxonomy page requests and simply 404.

<?php
add_action('init', 'wpse94193_register');
function wpse94193_register()
{
    register_taxonomy('your_taxonomy', 'your_post_type', array(
        // other stuff here...
        'query_var' => false,
    ));
}

If you do need to allow logged in users to view the taxonomy pages (can't tell from the question), that's different story.

If you just want to "turn off" the public facing part of a taxonomy (eg. just use it for grouping), you can do that when you register it.

Just set the query_var argument to false and WordPress will not recognize taxonomy page requests and simply 404.

<?php
add_action('init', 'wpse94193_register');
function wpse94193_register()
{
    register_taxonomy('your_taxonomy', 'your_post_type', array(
        // other stuff here...
        'query_var' => false,
    ));
}

If you do need to allow logged in users to view the taxonomy pages (can't tell from the question), that's different story.

Source Link
chrisguitarguy
  • 21.5k
  • 5
  • 62
  • 99
Loading