changing static link to relative link

I have self hosted my wordpress today, but I realised it is still having static link of my local installation, since now I am opening using my IP (as i haven’t done DDNS yet) i want that link should change to IP followed by ret of the URL instead of static local url.

Any help would be greatly appreciated.



  1. prosti
    0 Votes

    I guess you need to simple set your web server IP in wp-config.php like this:


    And try if you don’t have the web server problem.

    curl -I

    and if you access the

    curl -I

    is it forwarding properly…

    Important! Leaving the RELOCATE constant in your wp-config.php file is insecure, as it allows an attacker to change your site URL to anything they want in some configurations. Always remove the RELOCATE line from wp-config.php after you’re done.


  2. Naresh Kumar.P
    0 Votes

    I am happy that i would suggest you with some strategies so that you may find which one is useful and make use of it as per the scenarios that you are pertaining to it.

    Solution One:

    Bit Easier with the help of the plugin in WordPress.

    Plugin Name: Relative URL

    Plugin URL:

    Description: Relative URL applies wp_make_link_relative function to links to convert them to relative URLs.

    Solution Two:

    How to Make Internal Links Relative in WordPress

    Reference: I have found out a very easy and worth example so that you can follow it up and you can make the static links to relative on the fly.

    Solution Three:

    An another Stack Overflow Answer that is found very useful when using relative URL is as follows:

    Question: Relative URLs in WordPress


    Solution Four:

    Another Informative posts that i have found to be is the below link and it is very much superb in order to make the relative URLS.


    Hope so any of the methods will be useful and you may crack the hindrance that you have using these four methods on the fly.

    Happy Coding 🙂

Please signup or login to answer this question.

Signup for an account and start participating in our site today!

Social Signup

You can also login with your Facebook, Twitter or Linkedin account

Log in with Facebook