Skip to content

Instantly share code, notes, and snippets.

View AcademicHumber's full-sized avatar
💭
Coding

Humber AcademicHumber

💭
Coding
View GitHub Profile
@mattclements
mattclements / function.php
Last active October 29, 2024 22:04
Wordpress Disable Comments (add to function.php)
<?php
add_action('admin_init', function () {
// Redirect any user trying to access comments page
global $pagenow;
if ($pagenow === 'edit-comments.php') {
wp_redirect(admin_url());
exit;
}