Forums

WordPress is removing spaces in query strings (4 posts)

  1. ashworth102680
    Member
    Posted 1 year ago #

    We have a URL structure like this...

    http://mydomain.com/some-category/?subject=Some+Subject

    I'm trying to get pagination properly working. I urlencode() the space and get the +, but it doesn't matter if I use a space or a + ...Wordpress always tries to do this...

    http://mydomain.com/some-category/page/2/?subject=SomeSubject

    ...instead of this...

    http://mydomain.com/some-category/page/2/?subject=Some+Subject

    WordPress is removing the space/+ for some reason. We haven't figured out why just yet. Any help is greatly appreciated.

    Another user posted something in the plugins category, but probably wasn't going to get much visibility since it was posted in the wrong category. Thanks for your help.

  2. ashworth102680
    Member
    Posted 1 year ago #

    5 days and nobody's run into this? :(

  3. AndyGCook
    Member
    Posted 11 months ago #

    Having the exact same problem and haven't been able to figure it out. I'll let you know if I come up with a solution.

  4. Erwin Smeman
    Member
    Posted 11 months ago #

    The problem is caused by the canonical redirect checked on using a theme. If you place
    remove_action('template_redirect','redirect_canonical');
    in the functions.php file belonging to your template, the problem is fixed.

    If you want more information, see
    this related issue.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.