Add a trailing slash at the end of the category URLs

Short Answer

If your category URLs look like /?category=761, you are still on Plain permalinks.
Switch to any “pretty” structure (e.g. /%category%/%postname%/) and save—WordPress will output /category/slug/ with the trailing slash.

Already on pretty permalinks and the slash is still missing? Add this in a site-specific plugin or Code Snippets:

add_filter( 'category_link', 'force_cat_slash', 10, 2 );
add_filter( 'term_link',     'force_cat_slash', 10, 2 ); // tags & custom taxonomies

function force_cat_slash( $link ) {
    return trailingslashit( $link );
}

Flush permalinks once (Settings → Permalinks → Save).
All category (and other taxonomy) links will now end with /.


• Diagnose

  1. Settings → Permalinks
    If it says “Plain”, change it.
  2. Click Save even if nothing changed (flushes rewrite rules).
  3. Visit https://example.org/category/your-slug/ to confirm the slash.

• Fix (if still no slash)

  1. Add the filter above — light-weight, future-proof.
  2. Refresh permalinks after adding the code.

• Alternate catch-all redirect (server level)

Apache – place above the WP block in .htaccess:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ /$1/ [L,R=301]

Nginx – inside server {}:

location ~ [^/]$ {
    return 301 $uri/;
}

• Why bother?

  1. SEO/category/slug and /category/slug/ are distinct; choose one, redirect the other.
  2. Caching/CDN keys – path must be unique and canonical.
  3. Consistency – matches WordPress’s default permalink behaviour for posts and pages.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)