

// Disable comments completely
function disable_comments_everywhere() {

    // Close comments on the front-end
    add_filter('comments_open', '__return_false', 20, 2);
    add_filter('pings_open', '__return_false', 20, 2);

    // Hide existing comments
    add_filter('comments_array', '__return_empty_array', 10, 2);

    // Remove comments page from admin menu
    add_action('admin_menu', function () {
        remove_menu_page('edit-comments.php');
    });

    // Redirect comments page if accessed directly
    add_action('admin_init', function () {
        global $pagenow;

        if ($pagenow === 'edit-comments.php') {
            wp_redirect(admin_url());
            exit;
        }

        // Remove comments from dashboard
        remove_meta_box('dashboard_recent_comments', 'dashboard', 'normal');

        // Remove comment support from all post types
        foreach (get_post_types() as $post_type) {
            if (post_type_supports($post_type, 'comments')) {
                remove_post_type_support($post_type, 'comments');
                remove_post_type_support($post_type, 'trackbacks');
            }
        }
    });

    // Remove comments from admin bar
    add_action('init', function () {
        if (is_admin_bar_showing()) {
            remove_action('admin_bar_menu', 'wp_admin_bar_comments_menu', 60);
        }
    });
}

add_action('init', 'disable_comments_everywhere');
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="//dev.osteopathenyon.ch/wp-content/plugins/wordpress-seo/css/main-sitemap.xsl"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<sitemap>
		<loc>https://dev.osteopathenyon.ch/post-sitemap.xml</loc>
		<lastmod>2023-10-25T08:38:14+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://dev.osteopathenyon.ch/page-sitemap.xml</loc>
		<lastmod>2025-04-28T15:17:26+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://dev.osteopathenyon.ch/physiotherapist-sitemap.xml</loc>
		<lastmod>2025-04-28T15:14:53+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://dev.osteopathenyon.ch/category-sitemap.xml</loc>
		<lastmod>2023-10-25T08:38:14+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://dev.osteopathenyon.ch/post_tag-sitemap.xml</loc>
		<lastmod>2023-10-25T08:38:14+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://dev.osteopathenyon.ch/author-sitemap.xml</loc>
		<lastmod>2023-10-11T09:35:57+00:00</lastmod>
	</sitemap>
</sitemapindex>
<!-- XML Sitemap generated by Yoast SEO -->