#1 WordPress forum plugin created by gVectors Team

wpForo – WordPress Forum Plugin
  • Home
  • Forum
  • Migrate to wpForo
  • Addons
  • Addons Demo
  • Documentation

Forum

Home | Forum

wpDiscuz - WordPress Comment Plugin
  • Forums
  • Members
  • Recent Posts
Forums
Main Support Forums
General Discussions
user can view domai...
 
Share:
Share
Tweet
Share
Notifications
Clear all

user can view domain/wp-admin page

    Last Post
RSS

ufuk
Posts: 7
 ufuk
Topic starter
March 21, 2021 4:33 pm
(@ufuk)
Active Member
Joined: 6 years ago

hi,

 

Registered users can view domain/wp-admin page.

 

how can i disable this?

 

thank you.

 

 

 wp-admin.PNG

Gıda Bilimi Forumu

7 Replies
Tutrix
Posts: 632
 Tutrix
Beta Tester
March 21, 2021 4:40 pm
(@tutrix)
Honorable Member
Joined: 2 years ago

@ufuk

Dashboard > Forums > Settings > Features Tab > Show Admin Bar for Members

Features

 

 

visit my wpForo > Tutrix.de with lots of customization & modification, inclusive chat

Reply
ufuk liked
4 Replies
ufuk
 ufuk
(@ufuk)
Joined: 6 years ago

Active Member
Posts: 7
March 21, 2021 4:57 pm
Reply toTutrixTutrix

@tutrix thanks. i dit it. bar disappered but if a user type domain/wp-admin can go and login then see the page. Ok user has not have admin privileges but it is not nice 🙁

This post was modified 1 year ago 2 times by ufuk

Gıda Bilimi Forumu

Reply
Tutrix
 Tutrix
Beta Tester
(@tutrix)
Joined: 2 years ago

Honorable Member
Posts: 632
March 21, 2021 5:19 pm
Reply toufukufuk
Tutrix

@ufuk

you can add this code to the functions.php of your WP theme

function restrict_admin()
{
	if ( ! current_user_can( 'manage_options' ) ) {
                wp_redirect( site_url() );
                exit;
	}
}
add_action( 'admin_init', 'restrict_admin', 1 );

visit my wpForo > Tutrix.de with lots of customization & modification, inclusive chat

Reply
ufuk liked
ufuk
 ufuk
(@ufuk)
Joined: 6 years ago

Active Member
Posts: 7
March 21, 2021 5:30 pm
Reply toTutrixTutrix
ufuk
Tutrix

@tutrix it worked. Thank you so much 😊

Gıda Bilimi Forumu

Reply
Tutrix
 Tutrix
Beta Tester
(@tutrix)
Joined: 2 years ago

Honorable Member
Posts: 632
March 21, 2021 5:58 pm
Reply toufukufuk
Tutrix
ufuk
Tutrix

@ufuk

use this code instead of the one above, otherwise the ajax.php will be blocked and some things will no longer work

add_action( 'init', 'wpse_182220_init' );
function wpse_182220_init() {

// Exit function if doing an AJAX request
if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
return;
}
}
function restrict_admin() {

if ( ! current_user_can( 'manage_options' ) && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) {
wp_die( __( 'You are not allowed to access this part of the site' ) );
}
}
add_action( 'admin_init', 'restrict_admin', 1 );

see also https://wordpress.stackexchange.com/questions/182220/plugin-init-hook-fires-repeatedly

visit my wpForo > Tutrix.de with lots of customization & modification, inclusive chat

Reply
ufuk
Posts: 7
 ufuk
Topic starter
March 21, 2021 4:59 pm
(@ufuk)
Active Member
Joined: 6 years ago

by the way your forum is very nice 😉 

Gıda Bilimi Forumu

Reply
Tutrix liked
Robert
Posts: 9090
Robert - Twitter
 Robert
Admin
March 22, 2021 11:26 am
(@robert)
Support Team
Joined: 6 years ago

Why not just use a plugin to restrict admin access?

https://wordpress.org/plugins/remove-dashboard-access-for-non-admins/

In case you want to say thank you !)
We'd really appreciate and be thankful if you leave a good review on plugin page. This is the best way to say thank you to this project and support team.

Reply
  All forum topics
  Previous Topic
Next Topic  

Forum Search

Join Us!

Download wpForo plugin
on WordPress.org

wpForo Addons

wpforo-private-messages wpforo-advanced-attachments-128x128 wpforo-embeds-128x128 wpForo User Custom Fields addon wpForo – Blog Cross Posting addon wpForo Ads Manager wpForo – WooCommerce Memberships Integration wpForo Emoticons wpForo – Tenor GIFs Integration
View all Addons »

Recent Topics

  • Attachments not showing on forums posts after migration

    By Formicid, 23 hours ago

  • New Feature About Plugin Customization and Integration

    By z14165899, 1 day ago

  • WordPress Email sending function wp_mail() doesn't work!

    By feassistant, 2 days ago

  • Import users from IPBoard

    By jesusdlg, 2 days ago

  • Intruder signing in to wpforo without approval

    By plaurits, 3 days ago

  • How to make new user to get approve manually before creating post and profile.

    By Adhyansh21, 4 days ago

Topic Tags

  • css52
  • translation50
  • plugin conflict48
  • seo47
  • new features45
  • buddypress43
  • avatar41
  • moderation40
  • ultimate member40
  • login40
  • forum40
  • registration37
  • threaded layout35
  • cache34
  • spam33
  • editor33
  • menu33
  • shortcode32
  • forum accesses30
  • widget29
View all tags (2195)

Recent Posts

  • RE: replacing create_function() with something else for PHP8 [duplicate]

    @douglajonson you have got the solution here > Sta...

    By Tutrix, 14 hours ago

  • Member Reputation with Likes?

    Currently members can level up by posting messages in t...

    By Marco Panichi, 14 hours ago

  • Hide user roles from Members list

    Hi, Is it possible to hide a specific group of users ...

    By Marco Panichi, 14 hours ago

  • RE: There are versions of wpforo functions that return string?

    Amazing 👍

    By Marco Panichi, 16 hours ago

  • RE: Description for each topic?

    @christine, wpForo does not have a topic description ...

    By Chris, 23 hours ago

  • RE: About Plugin Customization and Integration

    Hi @z14165899, Please send your request to sales[at]g...

    By Chris, 23 hours ago

  • Attachments not showing on forums posts after migration

    Hello I just did a manual migration and the older forum...

    By Formicid, 23 hours ago

Share:
Share
Tweet
Share
  Forum Statistics
21 Forums
9,942 Topics
50.3 K Posts
3 Online
48.5 K Members

Latest Post: replacing create_function() with something else for PHP8 [duplicate] Our newest member: onix gaming slot sultan toto s... Recent Posts Unread Posts Tags

Forum Icons: Forum contains no unread posts Forum contains unread posts

Topic Icons: Not Replied Replied Active Hot Sticky Unapproved Solved Private Closed

Powered by wpForo | Copyright © 2016-2022 gVectors Team
Copyright Registration Service - Click here for more information or to register work
wpForo is Registered with the IP Rights Office
Copyright Registration Service

Ref: 4477265538
  • Home
  • Forum
  • Migrate to wpForo
  • Addons
  • Addons Demo
  • Documentation