Tuesday, June 7, 2022
HomeWordPress Developmentplugins - Methods to manipulate the content material inside wp_head

plugins – Methods to manipulate the content material inside wp_head


I’m seeking to create a plugin which can permit me to replace content material inside the wp_head operate. I’ve the beneath code which is ok in permitting me so as to add new content material through the wp_head load occasion;

<?php
operate manipulate_head() {
    ?>
        <title>It is a second title</title>
    <?php
}

add_action('wp_head', 'manipulate_head');

Nevertheless it doesn’t permit me to take away or substitute one thing that’s already inside the <head> tags on the web page.

An instance can be to replace the <meta identify="description"> tag within the part of the web site. The web site might have a <meta identify="description"> wherein case we have to replace the content material, in any other case we have to add a brand new one.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments