I need to remove all front-end admin functions. Not just hide them. The code to remove the admin bar in function.php does not work. And there are all these little edit things popping up everywhere. What can I do to have the front end look the same whether you are logged in or not?
Hi,
What exactly do you want to remove and is coming from the theme? I will try to help you if possible.
The admin bar does not belong to the theme, it is provided by WordPress. Try this solution to remove it
– https://www.wpbeginner.com/wp-tutorials/how-to-disable-wordpress-admin-bar-for-all-users-except-administrators/
The code will remove the admin bar for all users except the admin, if you want to remove the bar for the admin, remove the condition
– https://www.screencast.com/t/7eVVfV4nz
Or disable it in the WordPress user settings screen
– https://www.screencast.com/t/18JTKPHr
Thanks
There are little edit things in the top left-hand corner of the pictures. Sure I can hide them with CSS. But I want them to not show up.
I did that admin bar removal code in the child theme. Did not work. Used a plugin and that worked. Would rather use the code though.
Those are indeed coming from the theme, they are displayed for users that have the capability to edit posts quickly, as a shortcut. It will appear from author level users and above, they are the only ones that will see the edit option.
If you want to disable this, there is no actual setting for it. You could remove it from the code however
– https://www.screencast.com/t/clFAZtoiVynD
Comment or remove this code from the file shown and the edit option will no longer appear.
Sure that would be true unless you are doing the worlds best cacheing because your site is getting thousands of hits a second sometimes cause you have hundreds of thousands of visitors on push notifications. In which case many times it would show up for all your users not just those with author permissions.
Can you provide a real fix for this? Something I can put in my child functions.php or that is in the admin controls. I am not going to be able to update till I have somthing.
What exactly do you mean that it will show for all users? It will appear for users with capability to edit published posts, given to them by WordPress
– https://www.screencast.com/t/ES0lRj3s5
– https://www.screencast.com/t/KbrtMd70QPi6
– https://codex.wordpress.org/Roles_and_Capabilities
So that means authors and above, that is the condition. It is impossible to show for subscribers for example.
Comment or delete the code and the edit option will not appear. This is then solution. A setting is not created for this because as far as I can remember, there were very few user request. Sorry for the inconvenience.
Really impossible? So you are telling me if you cache a webpage fully. So essentially it is HTML in the cache of the serving server. A logged in user will not populate that cache. Then the logged in version would not be served to all the following users till that cache is cleared?
Still sure impossible is the correct word?
How many licensed users would have to request this before you can give me a real fix instead of a patch? I am sure I could come up with enough.
I am very sorry if this is an inconvenience, the solution I mentioned would be the only way.
I can add this on our request list and it will be considered, but I cannot promise if a dedicated setting will be implemented.
This option is considered a feature, users that have the right are able to edit the post directly from the page, not by searching for it in the backend. It is very helpful.
There is no way to do it with a child theme?
“This option is considered a feature, users that have the right are able to edit the post directly from the page, not by searching for it in the backend. It is very helpful.”
This is a joke, right? You don’t understand how full page cache works do you?
Note that we had no other requests such this as far as I can remember. We are not aware that this simple edit option can result in such an inconvenience.
Through a child theme this modification would not be possible, only in the main theme.
If this is interfering with your website in such a level and you are not satisfied with the theme for this reason, we could provide you a refund is you request it. Sorry again for the inconvenience.
Proper page caching does not show conditional states in WordPress .. WP uses a session cookie to set user status and determine which micro-cached (transient) elements to show a user. So, if a cookie is set as a logged in user, then that user ‘level’ (role) would be able to see an edit button — this has been a standard in WP themes for many many years across hundred thousand themes. It is indeed considered a core ‘feature’ of WordPress.
A visitor to site without a user cookie would only see a public cached copy without any user transient extensions added to a page — just like a non-logged in user would not see the cached user bar at top of a post page, or an edit comments function, or plug-in specific functions from page builders (e.g., site origin, themify, td composer, etc.).
Welcome to WordPress!
Thanks for joining the party(I know that sounds sarcastic. But I am seriously grateful for any help). I am well aware of how it works.
But on my sites, I employ offsite caching solutions that mean I would need to be able to read cache headers on that solution which is more server time and frankly a lot more complicated than just removing the front end admin functions on WordPress.
We are about to beta and are going to start testing publicly next week if you are interested.
I don’t need a refund. I am testing out compatibility.
No worries. I’ve been doing webdev since 1994, using WP since 2004, and have been managing our web servers since 1996. 🙂
So, we run a lot of high traffic news portals as well as our company B2B sites. We run WP with server side caching, and so well aware of WP behaviors. So, a ‘static’ page still has cookies loaded via PHP, and content is still added via the handler even with so-called static pages. A normal site visitor would not see an edit button. This is why you don’t see edit buttons for TIME magazine (running on WP VIP platform).
We’ve never had this issue on our sites, so I guess I was trying to give you some level of comfort there.
Personally I find injected ‘edit with pagebuilder’ buttons annoying in WP, and have always thought so — but I have this issue with all platforms going back to first version of Canvas (to date myself a little bit more).
So, to chime in – it *would* be nice to have option to remove pesky “edit this page” items when logged in for the admin user, even if via a filter hook in t he WP API.
I guess they did give you possible solution for that, so if ultra paranoid that would be the best way to go. Still, I’ve never seen a client make note of a “why is there and edit button on the photo on your home page …”
Or, put yet another technical way: proper caching plugins make a static copy of the ‘public’ DOM/render, which would be considered the rendered page with a ‘subscriber’ or ‘anonymous’ role/cookie level; not an admin level state. So, technically unless the cache method is ‘misconfigured’ — a static version of a page/post would never render with the user role/cookie state of superuser, admin, editor or author. With those user role/levels, an ‘edit’ button would not render with the DOM, and so never be part of a static page rendered and stored for public consumption.
Easily tested, by the way, through mechanisms like “fetch and render” tools like Google, Chrome Incognito mode, etc.
-
This reply was modified 8 years by
simchris.
You say misconfigured. I say intentionally configured so the server takes 0 loads on repeated requests on those pages regardless of who the user is.
I seriously appreciate your thoughts on this.
I have only been doing web dev Since 99 so you have me beat by a few years. I technically used B2 back in 2002 but I never really got into it. Guess it depends on what you consider WordPress or not. Though never really did it as my main income till several years later. These days I don’t make the time for development having to spend my time on other tasks.
Seriously though I hit you up on Facebook and LinkedIn. Get back to me if you can spare a few minutes. Would love to hear the solution your hinting at. Though I think we have already started on that.