Forums

How to remove the themes canical feature (2 posts)

  1. badmaash
    Member
    Posted 2 years ago #

    I have wordpress installed in a subfolder and on the main domain have an oscommerce script running. Whenever I try to access the blog the following error is thrown:

    Warning: Unexpected character in input: ' in /usr/bin/php5-cgi on line 4009

    Warning: Unexpected character in input: '' (ASCII=4) state=1 in /usr/bin/php5-cgi on line 4009

    Parse error: syntax error, unexpected '$' in /usr/bin/php5-cgi on line 4009

    So this is probably becuase the oscommerce and wordpress canonical features have a clash.

    How do I remove the canonical feature from this theme? I have have tried adding the following code into the functions file but it did not work:

    remove_filter('template_redirect','redirect_canonical');

    Thanks

  2. Shane G
    Member
    Posted 2 years ago #

    Hi,

    Add this code in functions.php of current active theme to remove canonical redirection in wordpress blog:

    remove_action('template_redirect','redirect_canonical')

    Note: that do not want to leave this code permanently because it is bad for SEO to have the wrong URLs returning results.

    Thanks,

    Shane G.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags