Plugin Directory

Changeset 3030853


Ignore:
Timestamp:
02/03/2024 11:12:43 AM (2 years ago)
Author:
freemp
Message:

Removed users section from WordPress built-in sitemap. Suggested by @constracti. Thanks!

Location:
disable-author-archives/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • disable-author-archives/trunk/disable-author-archives.php

    r2634264 r3030853  
    44 * Plugin URI: https://wordpress.org/plugins/disable-author-archives
    55 * Description: Disables author archives and makes the web server return status code 404 ('Not Found') instead.
    6  * Version: 1.3.1
     6 * Version: 1.3.2
    77 * Author: freemp
    88 * Author URI: https://profiles.wordpress.org/freemp
     
    3535add_filter( 'author_link', function() { return '#'; }, PHP_INT_MAX );
    3636add_filter( 'the_author_posts_link', '__return_empty_string', PHP_INT_MAX );
     37if ( class_exists( 'WP_Sitemaps' ) )
     38    add_filter( 'wp_sitemaps_add_provider',
     39        function( $provider, $name ) {
     40            if ( $name === 'users' )
     41                return false;
     42            return $provider;
     43        }, PHP_INT_MAX, 2 );
  • disable-author-archives/trunk/readme.txt

    r2992949 r3030853  
    2929== Changelog ==
    3030
     31= 1.3.2 =
     32* Removed users section from WordPress built-in sitemap. Suggested by @constracti. Thanks!
     33
    3134= 1.3.1 =
    3235* Removed View link from admin's Users list. Suggested by @khaiknievel. Thanks!
Note: See TracChangeset for help on using the changeset viewer.