Search
 
SCRIPT & CODE EXAMPLE
 

PHP

wordpress add sitemap.xml to robots.txt dynamically

/**
 * Add Yoast SEO sitemap to virtual robots.txt file network wide
 * https://wphelper.site/robots-txt-yoast-sitemap-multisite/
 */
function wphelper_network_robotstxt_function( $output, $public ) {
    $homeURL = get_home_url();
 
    $output .= "Sitemap: $homeURL/sitemap_index.xml
";
     
    return $output;
}
add_filter( 'robots_txt', 'wphelper_network_robotstxt_function', 20, 2 );
Comment

PREVIOUS NEXT
Code Example
Php :: how to remove words in contain integer php 
Php :: wordpress curl wp remote post timeout error 
Php :: set additional params to form laravel 
Php :: php: Güvenlik Fonksiyonu 
Php :: laravel eloquent query with orderBy subquery 
Php :: laravel gigapay delete employee 
Php :: Simple half pyramid pattern 
Php :: order by array like sql php 
Php :: GZIP COMPRESSION Using PHP 
Php :: laravel tricks and tips 
Php :: php Get location date format 
Php :: laravel-filemanager not working 
Php :: "A non well formed numeric value encountered 
Php :: Send Message from server laravel 
Php :: global phpcs 
Php :: Laravel To determine if an item is not present in the session 
Php :: File: C:xampphtdocsmarvellogistikapplicationlibrariesProfiler.php Line: 386 Function: sendDataInHeaders 
Php :: faire un fichier zip en php 
Php :: use app http models in laravel 8 
Php :: get woocommerce customers object 
Php :: Laravel eloquent tricks 
Php :: Relationship 1-n multiple BACKPACK Laravel 
Php :: MethodNotAllowedHttpException 
Php :: php know if city exist gmap api 
Php :: symfony send exception 
Php :: larvael die and dump facade 
Php :: How to on auto_recording using zoom api in php 
Php :: Access app.php values laravel 
Php :: hook de pré-commit se déclenche 
Php :: laravel where has relation 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =