Archived topic
How To Add an Edit Button on Posts and Pages in WordPress
3 replies · Started by Leon on June 12, 2022
When I visit a page or post on the front end of my site, while logged into WP Admin, I want to be able to click a button in the WP toolbar at the top so I can edit the page or post, which saves having to search for the page via the WP admin tools.
Is there any way I can add this please? I have tried editing PHP using Code Snippets plugin. Or do I need to change my theme?
Thank you.
Hi Leon,
The edit button should be there by default - it's a WP core function as far as I understand.
Please see this video for demonstration using my clean install:
https://www.screencast.com/t/E4MCVSRaXOro
Have you tried disabling all plugins except GP Premium to see if any of your plugins is causing a conflict?
Do you see the edit button when using a Twenty series WP theme?
Hello Leo,
Thanks for your prompt and helpful assistance.
I tried disabling GeneratePress and activating the Twenty Twenty Two Theme, without success.
I was about to deactivate my plugins, though this is a slow manual one by one process these days because, oddly, the bulk plugin action drop-down menu no longer includes 'Deactivate' (or Delete), when I found a code solution which solves the issue for both pages and posts.
In case it helps anyone else here is the code in input into Code Snippets plugin:
function disable_wpcomtoolbar ( $modules ) {
if ( isset( $modules['masterbar'] ) ) {
unset( $modules['masterbar'] );
}
return $modules;
}
add_filter( 'jetpack_get_available_modules', 'disable_wpcomtoolbar' );
Glad to hear :)