• Resolved DmitrySh

    (@dmitrysh)


    Hi,
    Could you check canonical url for pages for current plugin version:
    /category/slug/page/2
    /tag/slug/page/2
    I have errors (“/” missing) on these pages:

    <!-- All in One SEO 4.7.6 - aioseo.com -->
    .........
    <link rel="canonical" href=".../category/slugpage/2" />
    .........
    <!-- All in One SEO -->

    instead of
    <link rel=”canonical” href=”…/category/slug/page/2″ />

    Thanks, Dmitry

Viewing 12 replies - 1 through 12 (of 12 total)
  • Hi @dmitrysh ,

    Thanks for reaching out!

    Could you please provide us with one or more of your site’s paginated URLs so we can take a look?

    Looking forward to helping you.

    Thread Starter DmitrySh

    (@dmitrysh)

    Hi @dmitrysh ,

    Thank you for sharing the URLs.

    The issue with the missing “/” in the canonical URL might be related to your WordPress permalink settings. Could you please follow the steps below to check and adjust these settings?

    1. Log in to your WordPress admin dashboard.
    2. Navigate to Settings > Permalinks.
    3. Look at the Custom Structure or the selected permalink option.
    4. If your site is configured to use trailing slashes, ensure the structure ends with / (for example, /%postname%/).
    5. Click Save Changes, even if no changes were made, to refresh your permalink structure.

    It’s always best to choose either with or without trailing slashes for your entire site to avoid duplicate content issues. Having both versions may confuse search engines, causing indexing and ranking problems.

    Please check these settings and let me know if the issue persists. I’ll be glad to assist further!

    Thread Starter DmitrySh

    (@dmitrysh)

    Hi @numbnerd14 ,

    I have

    • in general options site url and home without trailing slashes, like this https://site.url
    • in Permalinks -> Custom Structure without trailing slashes, also: /%postname%

    I have clicked Save Changes (without any changes before) but error still happening

    Thanks, Dmitry

    Hi @dmitrysh ,

    in?Permalinks?-> Custom Structure without trailing slashes, also:?/%postname%

    You’ll have to add a trailing slash there if you want your URLs to have a trailing slash.

    If you don’t want the trailing slash to appear in your URLs, then we’d recommend adding a redirection rule to your .htaccess file to prevent this issue.

    Here’s an example .htaccess redirect rule:

    # Remove trailing slashes
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.+)/$ /$1 [R=301,L]
    
    </IfModule>

    In AIOSEO, you can edit your .htaccess file from All in One SEO > Tools > .htaccess Editor:
    https://aioseo.com/docs/editing-the-htaccess-file-using-all-in-one-seo/

    However, the?.htaccess Editor?tab will only be visible if your server is running Apache. This is because other web server software doesn’t use an .htaccess file.

    In that case, you can reach out to your hosting provider and ask them to add a redirect rule that removes the trailing slash from the URLs.

    The goal is to keep both the URL and canonical URL same, whether it’s with a trailing slash or without a trailing slash.

    Let me know if you’ve any questions!

    Plugin Support Steve M

    (@wpsmort)

    Hi @dmitrysh,

    We haven’t heard back from you in a couple of days. I’m going to go ahead and close this thread for now. But if you’d like us to assist, please feel welcome to continue the conversation.

    Thanks!

    Thread Starter DmitrySh

    (@dmitrysh)

    Hi @numbnerd14 ,

    I don’t want the trailing slash to appear in my URLs.

    I have tried to add a redirection rule to my .htaccess file from your message, but issue with canonical url for paginated category and tag pages steel happend.

    I have tried other SEO plugin and canonical urls for these pages are displayed correctly:

    <link rel="canonical" href=".../category/slug/page/2" />

    with “/” between “slug” and “page”

    Thanks, Dmitry

    Hi @dmitrysh ,

    Could you please fill out the form on our website following the link below so that we can request more information and investigate the issue further for you?
    https://aioseo.com/contact/

    Thread Starter DmitrySh

    (@dmitrysh)

    HI @numbnerd14 ,

    I don’t have a premium account to submit tickets. You can easily replicate this error by configured Permalinks for Custom Structure without trailing slashes: /%postname% in your site.
    Thanks, Dmitry

    Hi @dmitrysh ,

    I’m sorry, but we couldn’t replicate the issue on our end following the steps you shared.

    However, you can still contact us (https://aioseo.com/contact/) via the basic question form as shown here – https://a.supportally.com/i/gB0YiL

    Looking forward to helping you there!

    strzeart

    (@strzeart)

    Hello,

    I have the same issue on paginated pages for categories and tags. After switching off your plugin, the issue disappears, so it is clearly connected to the plugin.

    /category/slug/page/2
    /tag/slug/page/2
    I have errors (“/” missing) on these pages:

    <!-- All in One SEO 4.7.8 - aioseo.com -->.........<link rel="canonical" href=".../category/slugpage/2" />.........<!-- All in One SEO -->

    instead of
    <link rel=”canonical” href=”…/category/slug/page/2″ />

    Plugin Support Prabhat

    (@prabhatrai)

    Hey @strzeart,

    I wanted to inform you that we’ve already identified this as an issue and our Development team is working on fixing it. I’ll ensure to notify you as soon as we have an update.

    Meanwhile, I can share a filter snippet that you can use to fix this.

    Here’s the filter code that you can use –

    add_filter( 'aioseo_canonical_url', function ( $canonical ) {
    if ( is_paged() && str_contains( $canonical, 'page/' ) && ! str_contains( $canonical, '/page/' ) ) {
    $canonical = str_replace( 'page/', '/page/', $canonical );
    }
    return $canonical;
    } );

    Please follow the steps below to add this filter code to your site using the WPCode plugin:

    1. Log into your WordPress site and go to Plugins > Add New.
    2. In the Search plugins field (top right), enter WPCode.
    3. Click on the Install Now button next to the result for WPCode as shown in this screenshot – https://a.supportally.com/i/tpZaaJ
    4. Click on the Activate button.
    5. Next, go to Code Snippets > Add Snippet?in the WordPress menu and click on the Add Your Custom Code (New Snippet) option – https://a.supportally.com/i/BXGqla
    6. Select PHP Snippet?as shown in this screenshot – https://a.supportally.com/i/EUoSxc
    7. Add the code above to the text area and give the snippet a title. For example, Add missing slash to paginated categories.
    8. Finally, set the toggle to Active and Save Snippet. Screenshot – https://a.supportally.com/i/Mxie03

    Once done, see if the missing slash is added in the source code.

    Let me know if you run into any problems. I’m looking forward to helping you.

    Thanks.

Viewing 12 replies - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.