M Ureeb
asked 7 years ago

my author slug base appears to be: www.website.com/post-author/name, where as it should be like www.website.com/author/name.

please tell me the code to remove "post-" from the slug base.

1 Answers
DominicStaff
answered 7 years ago

Have you tried change the permalink to Post name as the following image: http://prntscr.com/7xh0vu

By default WordPress uses your username as author URL slug, and /author/ as the base. A user with the username JohnDoe will have an author URL like this:
http://example.com/author/johndoe
Hope this helps !

ureeb
replied 7 years ago

i am just asking to remove the "post-" from the url, it should display like http://www.abc.com/author/name. right now its showing as /post-author/name

ureeb
replied 7 years ago

only author slug, it doesn’t have to do anything with post permalinks. i only want to remove "POST-" from the author URL.

dominic Staff
replied 7 years ago

You can add the following code to the functions.php file:

add_action('init', 'cng_author_base');
function cng_author_base() {
    global $wp_rewrite;
    $author_slug = 'author'; // change slug name
    $wp_rewrite->author_base = $author_slug;
}

Or use the Edit author Slug plugin: https://wordpress.org/plugins/edit-author-slug/
Hope this helps !

Powered by DW Question & Answer Pro