How do I disable the changing of the permalink for published posts (for non-admin)?

You could do something like the following, this should go in your Child Theme’s functions.php or if not using a Child Theme then add to a custom plugin: function hide_permalink_metabox( $is_post_edit_page ) { if ( !current_user_can(‘update_core’) ) { // allows Admins to edit the permalink echo ‘<style> div#edit-slug-box {display:none!important;} </style>’; } You may need to … Read more

Adding tag slug to post permalink

You need to add a new tag (e.g. %tag%) that you can use in post links. One possibility is to use the add_rewrite_tag() function. Then use the post_link filter to replace the %tag% in the link with the appropriate value. Finally, change the post link structure in the settings. Settings -> Permalinks -> Custom Structure: … Read more

Duplicate Content Issue with WordPress Permalink Structure and Primary Categories

function get_current_post_ID() { $postid = get_queried_object_id(); $post_url = get_permalink( $postid ); //wp_redirect( $post_url ); if( has_category(”, $postid) && urldecode(‘https://’.$_SERVER [‘HTTP_HOST’].$_SERVER [‘REQUEST_URI’]) != $post_url ) : wp_redirect( $post_url, 308 ); exit(); endif; } add_action( ‘template_redirect’, ‘get_current_post_ID’ );

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)