Hi
I would like to remove the option to change permalinks in administration. How do I do that?
And how can I set a default permalink structure?
Thanks!
Hi
I would like to remove the option to change permalinks in administration. How do I do that?
And how can I set a default permalink structure?
Thanks!
Aaaaah, nevermind. Found my answers. :)
Would you mind sharing, in case someone else would like to know in the future? ;)
Oh, sure! :) In wp-admin folder open menu.php and delete or comment out the lines you don't want (in case of permalinks comment out line 63). Then delete or rename or empty or... file options-permalink.php.
Thanks.
Someone else may find that useful sometime. ;)
I see that you provided a solution to remove the option of modifying the permalinks structure, but did you mention how to set the default permalink structure?
yeah, i'd be curious to know that also!
The default settings are found in wp-admin/upgrade-schema.php
Currently line 262 shows the default permalink structure.
Most of the other default settings can be set from there too.
Yep, I just figured that out: http://mu.wordpress.org/forums/topic.php?id=1406&replies=5#post-7655 .
After removing a file from menu.php, you'll still need to add something such as this near top of any file you don't want prying eyes to execute:
if( is_site_admin() == false ) {
die( __('<p>You do not have permission to access this page.</p>') );
}
Please tell me which file do I have to add that line?
'After removing a file from menu.php, you'll still need to add something such as this near top of any file you don't want prying eyes to execute'
In the context of the post at the top of this thread, /wp-admin/options-permalink.php
Thank you. That was quick :)
In the newest MU version there is no 'upgrade-schema.php' file. Right now looking where to set up default permalinks. Any ideas?
But is "wp-admin/includes/schema.php" line 185
add_option('permalink_structure', '/%year%/%monthnum%/%day%/%postname%/');
It's been removed. On newer code bases, the permalinks are all set up as date-based. there's no option in the backend to change it.
that line you found above *is* what it is currently set to though.
Instead of hacking core files, why not use hooks now?
Check out wp-admin/includes/mu.php and look for the wpmu_menu() function. That hooks into the "_admin_menu" action to modify the $menu and $submenu array.
You can do the same by creating a new file in mu-plugins and dropping similar code in there to unset() the options-permalink.php array element.
On the off chance that someone does find options-permalink.php, and they will, use the "update_option_*" action to reset the permalink related options.
Or add a mu-plugin that checks if the current REQUEST_URI is /wp-admin/options-permalink.php and if it is die or redirect elsewhere. (that's what I'd do to avoid complications with reseting updated options)
Here's an mu-plugin that does exactly what Donncha is suggesting :)
http://wpmudevorg.wordpress.com/project/Removes-the-option-to-edit-permalinks
Enjoy!
Big thanks for help.
I had to edit permalinks - by default it's date-title which quite mess up with utf8 character set.
PS. I just published post, that my hook wasn't working and then saw your post. Ha, thanks!
This function will also be useful to 'turn off' other redundant options for back end users
Farms - that was quick, well done! :)
Just found this thread and haven't even thought of removing permalinks options for users. Here's an SEO question. Aside from the obvious benefit of not allowing your users to control their own permalinks, wouldn't there be some SEO advantage to having multiple sites, with different permalink structures pointing back to the main site? Instead of many sites, all with the same structure linking back?
I have no clue, I'm just throwing that out there for conversation;)
Read through all the replies the start of this thread is outdated and can't really find what I need so here goes.
Farms plugin works a treat and I will use that but I also need to set all new blogs to use the following permalink structure mainly for SEO:
/%category%/%postname%/
Could someone point me in the direction of which file to modify in MU (I'm using v2.7.1 Beta). Or, even better a similar or modified plugin to Farms one that allows you to specify the structure in the code before uploading...
N.
Thanks andrea.
N.