• I have a problem that many would not consider a problem at all, which is that all my sites images and internal links are relative.

    Strange thing is that I am clueless as to why this occurs, the native WP behaviour should be absolute paths.

    The lack of absolute paths is running me into troubles with one or two plugins, so I would like to change the default behaviour (yes, I can change all paths in the mySQL database, but that doesn’t do anything for future images and internal links).

    How to get back WordPress’ native absolute path behaviour…

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    What plugins do you have installed? Non-core functionality comes from plugins and/or code in the theme.

    Thread Starter Medical Writer

    (@scienterrif1c)

    Dear Steve,
    Thanks. Here’s the thing. I have had a plugin many months back when I switched from http to https, but it was uninstalled long time ago. There are currently no plugins and no theme that should cause this.

    Moreover, WordPress and my Theme have had several updates over the past few months, meaning that it should either be in my child theme, or in the plugins. But nothing should logically do that.

    Could there be a reason for plugins to change the behaviour, e.g. would it support a certain functionality? I am just trying to reason the other way around here.

    Thanks

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Are new links being added with relative paths or are you just dealing with old links?

    I have had a plugin many months back

    What plugin?

    Thread Starter Medical Writer

    (@scienterrif1c)

    Nope, not just old links. If I look in my media folder, I can see that all files uploaded – even today – are displayed with a relative path only. If I look into the source when visiting my page, all images have relative links in the source code.

    I am very positive it is something that is currently active.

    Guess the only way to troubleshoot is switching off all plugins and adding them one by one…which is so tedious to do…

    Thread Starter Medical Writer

    (@scienterrif1c)

    Just a thought, can there be some code in sunrise.php, rather than in function.php that would change from absolute to relative paths?

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    If you can install plugins, install “Health Check”: https://ww.wp.xz.cn/plugins/health-check/ On the troubleshooting tab, you can click the button to disable all plugins and change the theme for you, while you’re still logged in, without affecting normal visitors to your site.

    With HC in troubleshooting mode, you can turn on and off plugins from the admin bar.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    can there be some code in sunrise.php, rather than in function.php that would change from absolute to relative paths?

    Yes, you need to check that, too.

    Thread Starter Medical Writer

    (@scienterrif1c)

    Thanks Steve,
    I think I have found the issue, it was in my wp-config.php.
    There was an entry that said:

    define(‘WP_CONTENT_URL’, ‘/wp-content’);

    I have changed it to:
    define(‘WP_CONTENT_URL’, ‘https://mydomain.com/wp-content’);

    Which seems to add back the domain in all links.

    What are your thoughts?

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    If that works, go for it. πŸ™‚

    That’s an option define. https://codex.ww.wp.xz.cn/Editing_wp-config.php#Moving_wp-content_folder

    Thread Starter Medical Writer

    (@scienterrif1c)

    Thanks for that, and for your support. It definitely has been a learning curve today. Truly appreciate your time and making me think into the right direction.

    Cheers

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘How to get back WordPress’ native absolute path behaviour…’ is closed to new replies.