Update / Workaround (might help others)
I’m building a B2B site with GeoDirectory. I created my own custom CPTs with dedicated taxonomies, but I ran into two issues:
- The core CPT “Places” shows up everywhere (Dashboard → Statistics, Dummy Data, etc.) even if I don’t use it.
- Dummy Data: when I click “Insert posts” on my custom CPT (e.g., Stays), it still creates Places categories (Attractions, Hotels, Restaurants…), while my CPT stays empty. Also, deleting the dummy posts does not remove those categories.
What I did to “partially fix” it
- I kept Places registered (since it’s core) but hid it entirely in WP-Admin and in the GD dashboard.
- I stopped using Dummy Data for custom CPTs and now populate them via CSV import. I manually removed the Places demo categories once.
I’m sharing the small mu-plugin I’m using.
Put this file at: /wp-content/mu-plugins/hide-gd-places.php and, if you want, replace your_cpt with your GeoDirectory CPT slug.
`<?php
if ( ! defined('ABSPATH') ) exit;
$gd_admin_default_cpt = 'your_cpt';
add_filter('register_post_type_args', function ($args, $post_type) {
if ($post_type === 'gd_place') {
$args['show_ui'] = false;
$args['show_in_menu'] = false;
$args['show_in_admin_bar'] = false;
$args['show_in_nav_menus'] = false;
$args['show_in_rest'] = false;
$args['exclude_from_search'] = true;
// Intentionally not touching 'publicly_queryable'.
}
return $args;
}, 10, 2);
add_action('admin_menu', function () {
remove_menu_page('edit.php?post_type=gd_place');
}, 999);
add_action('admin_bar_menu', function ($bar) {
if ( is_admin() ) {
$bar->remove_node('new-gd_place');
}
}, 100);
function hgdp_is_gd_admin(): bool {
if ( ! is_admin() ) return false;
$page = isset($GET['page']) ? sanitize_key($GET['page']) : '';
return in_array($page, ['geodirectory','gd-settings','gd-status','gd-extensions'], true);
}
add_action('admin_print_footer_scripts', function () use ($gd_admin_default_cpt) {
if ( ! hgdp_is_gd_admin() ) return; ?>
<script>
jQuery(function($){
var $type = $('#gd_stats_type');
var targetCpt = <?php echo wp_json_encode( $gd_admin_default_cpt ); ?>;
function selectFirstNonPlaces(){
var $first = $('.gd-stats-nav [data-type]').not('[data-type="gd_place"]').first();
if ($first.length) {
var t = $first.data('type');
if ($type.length) $type.val(t);
$first.trigger('click');
}
}
if ($type.length && $type.val() === 'gd_place') {
if (targetCpt && $('.gd-stats-nav [data-type="'+targetCpt+'"]').length){
$type.val(targetCpt);
$('.gd-stats-nav [data-type="'+targetCpt+'"]').first().trigger('click');
} else {
selectFirstNonPlaces();
}
}
$('.gd-stats-nav [data-type="gd_place"]').closest('a,button,li,div').remove();
$('table tr').filter(function(){
if ($(this).find('[data-cpt="gd_place"]').length) return true;
var txt = $(this).find('td,th,label,span').first().text().trim().toLowerCase();
return txt === 'places';
}).remove();
});
</script>
<?php
});`
1) About Dummy Data: As of now there’s no demo pack for custom CPTs; using “Default” tends to seed Places taxonomies. The best workaround I found is to use CSV import to create 10–20 fake records in your custom CPT(s) so Places categories don’t get recreated.
2) Suggestion for the core: It would be great if GeoDirectory could, in the future:
- allow disabling/hiding Places in admin when it’s not used;
- let us choose exactly which CPT to install Dummy Data for (without touching Places) and optionally remove terms when uninstalling the dummy data.
Hope this helps anyone in the same situation. If there’s an official/better way, I’m happy to try it!