*

rooman

  • *****
  • 253 posts
Hello,

I am using the forum plugin in Osclass, and I’ve encountered an SEO issue where Google is indexing user profile pages directly, such as:

localhost/ar/forums/user/username

These pages are appearing in search results with the usernames, and I do not want them to be indexed.

I tried to find the cause of the issue, but I couldn’t find any clear setting within the plugin to prevent this.

My questions are:

Is there a setting in Osclass or the forum plugin to prevent indexing of user profile pages?
Or should I modify the template and manually add a meta robots noindex tag?
Is there a better solution to completely prevent these pages from appearing in Google without negatively affecting the forum’s SEO?

I would appreciate any clarification or solution

*

MB Themes

Re: Issue with indexing user profile pages in Google in the forum plugin
« Reply #1 on: April 16, 2026, 10:24:37 AM »
you will need to update theme custom.php file and codnition index/noindex based on it.
alternative is to use robots.txt to exclude localhost/ar/forums/user/* pages
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

rooman

  • *****
  • 253 posts
Re: Issue with indexing user profile pages in Google in the forum plugin
« Reply #2 on: April 16, 2026, 01:50:09 PM »
you will need to update theme custom.php file and codnition index/noindex based on it.
alternative is to use robots.txt to exclude localhost/ar/forums/user/* pages

Hello,

I have implemented the solution in the theme’s head.php file as suggested.

I added a conditional check to apply noindex, nofollow only to forum user profile pages (/forums/user/*), while keeping all other pages indexed normally.

Here is the implemented code:

Code: [Select]
<head>
  <?php osc_current_web_theme_path('head.php'); ?>

  <?php
    $current_url 
= $_SERVER['REQUEST_URI'];

    if (
strpos($current_url, '/forums/user/') !== false) {
  
?>

    <meta name="robots" content="noindex, nofollow" />
    <meta name="googlebot" content="noindex, nofollow" />
  <?php } else { ?>
    <meta name="robots" content="index, follow" />
    <meta name="googlebot" content="index, follow" />
  <?php } ?>

</head>

After applying this change, the pages are now correctly returning noindex, nofollow in the HTML source.

Please let me know if this is the recommended final approach or if there is a better plugin-level solution to handle this more cleanly.

Thank you.

*

MB Themes

Re: Issue with indexing user profile pages in Google in the forum plugin
« Reply #3 on: April 17, 2026, 01:02:02 PM »
it's fine, you can also use osc_get_osclass_location/section functions.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

rooman

  • *****
  • 253 posts
Re: Issue with indexing user profile pages in Google in the forum plugin
« Reply #4 on: April 17, 2026, 01:32:02 PM »
it's fine, you can also use osc_get_osclass_location/section functions.
Hello,

Thank you very much for your support and clarification.

I appreciate your help in confirming the correct approach and suggesting the use of Osclass native functions. The solution is now working properly, and the user profile pages are correctly handled with noindex.

Thanks again for your time and guidance.

Best regards.