• Hi,

    We have a webzine running on WordPress.
    Wordpress itself uses absulute links for all internal pages and posts.
    However, our webhost considers that as normal traffic and as a result of that we have reached our monthly limit of 10gb within the first 2 weeks and pay quite some money for overusage.

    Therfore I want to force WordPress to use relative links for its own pages, posts, etc only.
    Of course the links within the articles of the content itself need to be absolute links, I’m just talking about internal links WordPress uses for itself.

    Is there a plugin that can do this for me or where do I fix this in php?

    Hope somebody can help me out here as we losse quite some money each month for traffic usage.

    Thanks in advance.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Making WordPress URLs root relative

    WP is built around absolute URLs, so keep this in mind when you try out the above function.

    Thread Starter zakhooi

    (@zakhooi)

    Thanks for your reply but I get stucked here.
    I added both functions in functions.php of the theme I’m using but when I hoover over the menu items I still see absolute links.
    Could it be that those links reside somewhere in the database?
    Or am I missing something here? Something else that needs to be done?
    I do know my way how and where to change things but I’m not a php programmer, so sorry for asking.

    Thanks in advance …

    What the two above functions does is this:

    1. You can use the first function when you code, when you want to strip out for example: “https://www.example.com/hello” to-> “/hello”

    2. The second function is a filter added to modify the “the_permalink” filter, this filter is used for posts, pages and other post types for generating their permalink. So a post with permalink: “https://example.com/2011/09/27/hello-world” would become: “/2011/09/32”

    Your questions:
    1. The menu links is not affected by the “the_permalink” filter. So no, it would not effect the WordPress menu system. There might exist a similiar filter to modify these links, though that I do not know.

    Thread Starter zakhooi

    (@zakhooi)

    Well that was actually what I was looking for.
    Thanks for your help anyway.

    Thread Starter zakhooi

    (@zakhooi)

    Unfortunately this doesn’t help me wit my problem.
    I need to have the WordPress menu system to use root relative links.
    Were only halfway januari and already have 14Gb traffic. Each day costs us money.

    Is there anyone else who can help me with this?

    Thanks in advance

    Thread Starter zakhooi

    (@zakhooi)

    Over 175% data usage already. Please help!

    Thread Starter zakhooi

    (@zakhooi)

    Is it possible to make WordPress’ menu system relative using .htaccess?
    If so, what are the correct lines?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How to make wordpress site using relative links only?’ is closed to new replies.