WordPress Dashboard block only for administrators

When in WordPress, a user registers access to the Dashboard, although at first only access to the options that are allowed depending on the role that has assigned in many occasions we may be interested that they can not access, for this we must put the following code to our functions.php

add_action( 'init', 'blockusers_init' );

function blockusers_init() {
        if ( is_admin() && ! current_user_can( 'administrator' ) ) {
                wp_redirect( home_url() );
                exit;
        }
}

 

1.157 responses to “WordPress Dashboard block only for administrators

  1. bitcoincasino

    I’ve been looking for photos and articles on this topic over the past few days due to a school assignment, bitcoincasino and I’m really happy to find a post with the material I was looking for! I bookmark and will come often! Thanks 😀

  2. casino online

    I’ve been searching for hours on this topic and finally found your post. casino online, I have read your post and I am very impressed. We prefer your opinion and will visit this site frequently to refer to your opinion. When would you like to visit my site?

  3. casinosite

    As I am looking at your writing, casinosite I regret being unable to do outdoor activities due to Corona 19, and I miss my old daily life. If you also miss the daily life of those days, would you please visit my site once? My site is a site where I post about photos and daily life when I was free.

  4. 비아그라

    정품 비아그라,비아그라구매,비아그라구입,처방전없이 초간편주문.합리적인가격.비아그라 퀵배송,비아그라온라인약국,시알리스.각종 발기부전치료제 판매 전문 온라인스토어 13년동안 단 1건도 가품판매에 관한 스캔들이 없는 믿을수 있는 스토어 입니다.

  5. trade metals

    It’s actually very difficult in this busy life to listen news on Television, therefore I just use internetfor that reason, and take the newest information.Feel free to surf to my blog … sukko.com.ru

  6. EU organic cinnamon

    Hi, I do believe this is a great blog. I stumbledupon it 😉 I am going to come back yet again since I book marked it. Money and freedom is the greatest way to change, may you be rich and continue to guide other people.

  7. safetoto

    Looking at this article, I miss the time when I didn’t wear a mask. safetoto Hopefully this corona will end soon. My blog is a blog that mainly posts pictures of daily life before Corona and landscapes at that time. If you want to remember that time again, please visit us.

  8. learn more

    Hello there! Do you know if they make any plugins to help with Search Engine Optimization? I’m trying to get my blog to rank for some targeted keywords but I’m not seeing very good success. If you know of any please share. Kudos!

  9. ch?y qu?ng cáo livestream

    I am extremely impressed with your writing skills as well as with the layout on your blog. Is this a paid theme or did you modify it yourself? Anyway keep up the excellent quality writing, it?s rare to see a great blog like this one today..

  10. C_TS413_2021 practice test

    Hello there, just became aware of your blog through Google, and found that it is really informative.I am going to watch out for brussels. I’ll be grateful if you continue this in future.A lot of people will be benefited from your writing.Cheers!

  11. Sheridan Mellor

    This very blog is definitely entertaining additionally informative. I have picked a lot of interesting tips out of this source. I ad love to visit it again soon. Thanks!

  12. sim mobi

    Very well written story. It will be helpful to everyone who employess it, as well as me. Keep doing what you are doing – can’r wait to read more posts.

  13. Sharon Nicholson

    When I originally commented I clicked the «Notify me when new comments are added» checkboxand now each time a comment is added I get three e-mails with the same comment.Is there any way you can remove me from that service?Thank you!

  14. phenqpm review

    When I initially commented I clicked the «Notify me when new comments are added» checkbox and now each time a comment is added I get three emails with the same comment. Is there any way you can remove me from that service? Cheers!

  15. gia cua go cong nghiep

    I blog quite often and I truly appreciate your information. The article hasreally peaked my interest. I am going to book mark your blog and keep checkingfor new details about once a week. I opted in for your Feed too.

  16. tchp for sale

    Hello there, just became aware of your blog through Google,and found that it is really informative. I’m gonna watch outfor brussels. I’ll appreciate if you continue this in future.A lot of people will be benefited from your writing. Cheers!

  17. Buy Bitcoin

    I am now not certain where you’re getting your information, but great topic.I must spend some time learning more or understanding more.Thanks for great information I used to be on the lookout for this info for my mission.

  18. bitcoin

    Your style is really unique in comparison to other people I’ve read stuff from. Thanks for posting when you’ve got the opportunity, Guess I’ll just bookmark this blog.

  19. ??????

    Good write-up, I¡¦m normal visitor of one¡¦s blog, maintain up the nice operate, and It’s going to be a regular visitor for a long time.

  20. ???????

    Hi there, just became alert to your blog through Google, and found that it is really informative. I am going to watch out for brussels. I will appreciate if you continue this in future. Lots of people will be benefited from your writing. Cheers!

  21. giam can slim be

    It¡¦s actually a great and helpful piece of information. I¡¦m glad that you simply shared this helpful info with us. Please stay us up to date like this. Thanks for sharing.

  22. Maida Kneedler

    This is very interesting, You’re a very skilled blogger. I’ve joined your feed and look forward to seeking more of your great post. Also, I have shared your web site in my social networks!

  23. do mercedes

    Sweet blog! I found it while searching on Yahoo News. Do you have any tips on how to get listed in Yahoo News?I’ve been trying for a while but I never seem to get there!Cheers

  24. Cryptocurrency Exchange

    The particular moduleis done perfectly using spherical graining on the primary menu, directly graining around the chronograph levers, sandblasted as well as DLC covered connects plus a sunburst design on the Times fill.

  25. blog

    Great blog you have here.. It’s difficult to find quality writing like yours nowadays. I really appreciate people like you! Take care!!

  26. Shiloh Osborne

    Thanks , I’ve recently been looking for info about this subject for ages and yours is the best I have came upon till now. But, what in regards to the conclusion? Are you sure concerning the source?

  27. water slide rentals

    I do agree with all the ideas you’ve presented in your post. They are very convincing and will certainly work. Still, the posts are very short for beginners. Could you please extend them a bit from next time? Thanks for the post.

  28. Alma Coles

    At this time it appears like WordPress is the top blogging platform available right now. (from what I’ve read) Is that what you’re using on your blog?

  29. Melinda Gilbert

    Excellent blog you’ve got here.. Itís hard to find quality writing like yours these days. I really appreciate people like you! Take care!!

  30. Buy Proxies

    I will immediately grab your rss as I can not to find your e-mail subscription link or newsletter service. Do you’ve any? Please permit me understand so that I may just subscribe. Thanks.

  31. Islamic Bank Australia

    Hmm is anyone else encountering problems with the pictures on this blog loading?I’m trying to determine if its a problem on my end or if it’s the blog.Any responses would be greatly appreciated.

  32. Islamic Finance

    The title of the writer is Jere and he absolutely digs that identify. Interviewing is in which my major cash flow will come from but the marketing never ever comes. Years back we moved to Louisiana. Doing magic is what she loves performing.

  33. ????????

    I used to be recommended this blog by my cousin. I am no longer positive whether or not this post is written via him as nobody else recognize such exact about my difficulty. You are wonderful! Thank you!

  34. rijbewijs kopen

    Kopen een echt en geregistreerd rijbewijs van onze website zonder examens te schrijven of de oefentest te doen. alles wat we nodig hebben zijn uw gegevens en deze zouden binnen de komende acht dagen in het systeem worden geregistreerd. rijbewijs kopen belgië, rijbewijs kopen belgie, rijbewijs kopen in nederland, rijbewijs b belgie, rijbewijs kopen met registratie. https://rijbewijskopenbetrouwbaar.com/

  35. comprar carta de conduçao

    Comprar carta de condução legalmente, Comprar carta de condução sem pré-pagamento, uma carteira de motorista registrada compre experiências, comprar experiências de carta de condução, Comprar carta de condução sem exame Colônia, Comprar carta de condução porto, Comprar carta de condução sem exame portugal, Comprar carta de condução em portugal, comprar carta de condução lisboa, comprar carta de condução portugal.
    https://comprarcartadeconducaoportugal.com/

  36. comprare patente

    Comprare la patente di guida reale e registrata dal nostro sito Web senza scrivere esami o sostenere il test pratico. tutto ciò di cui abbiamo bisogno sono i tuoi dati e saranno registrati nel sistema entro i prossimi otto giorni. La patente di guida deve seguire la stessa procedura di registrazione di quelle rilasciate nelle autoscuole, l’unica differenza qui è che non dovrai sostenere gli esami. 
    https://patenteregistrata.com/

  37. JameswipLy

    Prescription Drug Information, Interactions & Side. Everything what you want to know about pills.
    stromectol uk
    Everything what you want to know about pills. drug information and news for professionals and consumers.

  38. Stock option

    Hi! I could have sworn Iíve been to this blog before but after looking at a few of the articles I realized itís new to me. Nonetheless, Iím definitely happy I discovered it and Iíll be bookmarking it and checking back often!

  39. Roth IRA

    Have you read any good books lately? children’s tylenol sleeplessness «There are jokes going around now,» she said. «‘Why did Mr. Obama cancel his trip? Maybe because he can’t pay his fuel and hotel bills.’ It’s not a funny joke.»

  40. Profit margin

    Oh my goodness! an incredible article dude. Thank you Nonetheless I am experiencing problem with ur rss . Don’t know why Unable to subscribe to it. Is there anybody getting similar rss problem? Anyone who is aware of kindly respond. Thnkx

  41. mampir ke orang-orang ini

    I blog quite often and I really appreciate your information. The article has really peaked my interest. I will book mark your site and keep checking for new information about once a week. I subscribed to your Feed too.

  42. Price quote

    Aw, this was an exceptionally nice post. Taking the time and actual effort to create a good articleÖ but what can I sayÖ I put things off a whole lot and don’t seem to get anything done.

  43. Nancy Reilly

    my father is in the office while my mother is attending a seminar there is only me and my driver who is also a helper in my house.

  44. Join us

    What’s Taking place i am new to this, I stumbled upon this I’ve found It absolutely helpful and it has aided me out loads. I hope to give a contribution & aid different customers like its aided me. Good job.

  45. have a peek at this site

    You’re so interesting! I don’t think I’ve read through a single thing like that before. So wonderful to discover somebody with original thoughts on this topic. Seriously.. thanks for starting this up. This website is one thing that is required on the internet, someone with a bit of originality.

Deja una respuesta

Tu dirección de correo electrónico no será publicada.

Rúa Pilar Miró n 6 Santiago de Compostela

Jersey St , Manchester, Greater Manchester M4 6JG, GB

T. 609 538 171 - 634 59 34 43

info@teslatechnologies.com