Replace https with http in wp_nav_menu <p>I want to replace all links in my main menu with http whenever they are https</p> <p>I have tried the function below but it has no effect</p> <pre><code>function wp_list_pages_custom() { $array = array(); $pages = wp_nav_menu( array( 'menu' =&gt; 'Main Menu', 'menu_id' =&gt; 'menu', 'echo' =&gt; true, 'fallback_cb' =&gt; 'wp_page_menu', 'before' =&gt; '', 'after' =&gt; '', 'depth' =&gt; 0 )); $pages = str_replace('https', 'http', $pages); echo $pages; } </code></pre>