WordPress.org

Forums

Remove links form source code header (3 posts)

  1. marrot76
    Member
    Posted 3 years ago #

    Hi there,

    I try to remove all links from the source code header (link to external .css and to some Javascript files. I tried with creating a function like this –

    <?php
    
    // Clean up the <head>
    
    function removeHeadLinks()
    {
    	remove_action('wp_head', 'rsd_link');
    	remove_action('wp_head', 'wlwmanifest_link');
    	remove_action('wp_head', 'wp_generator');
    	remove_action('wp_head', 'rel_link');
    }
    add_action('init', 'removeHeadLinks');
    
    ?>

    – but it´s not working. Can s.o. help me? Otherwise i don´t get the idea of copying wordpress in a crypted folder on the server out of security reasons when you can see the name of that crypted folder in the source code ...

  2. s_ha_dum
    Member
    Posted 3 years ago #

    The function wrapper is unnecessary complexity. Just use put the remove_action lines in your theme's functions.php and don't use the function part at all.

    What 'crypted' folder? Have I missed something?

    Also, it is really easy to figure out that you are looking at a WordPress install-- just look at the URL(s) for the stylesheet(s) and the javascript.

  3. marrot76
    Member
    Posted 3 years ago #

    Thanks,

    gonna try it out...

    There are some advice around not to copy the content of the wordpress folder directly in the root directory of your server but to save it in a separate folder you should name as weird as possible. So any bots scanning the site won´t be able to find the wp_files.

    That´s what I meant with "crypted" folder...

Topic Closed

This topic has been closed to new replies.

About this Topic