Way to change the author permalink in wordpress? - php

I am currently viewing members details using author.php - it all works perfectly but i want to change the /author permalink to /member. Ive done this but it takes me to a 404 page now.
add_action('init','change_author_permalinks');
function change_author_permalinks()
{
global $wp_rewrite;
$wp_rewrite->author_base = 'member'; // Change 'member' to be the base URL you wish to use
$wp_rewrite->author_structure = '/' . $wp_rewrite->author_base. '/%author%';
}

Login and go to the dashboard.
Then go to Settings > Permalinks and save the page. That flushes the rewrite rules and should then take you to the correct page when entering the new URL.
You could also use flush_rewrite_rules() but you should use that function sparingly and only when you need to. Saving the Permalinks page is the easiest way to go so you're not flushing the cache constantly.

Great plugin: https://wordpress.org/plugins/edit-author-slug/
This plugin works great. but some things you can do without a plugin.
Here is a perfect solution without a plugin, check it out this article. It is working fine for me.

This plugin may help: https://wordpress.org/plugins/edit-author-slug/
I used on several sites and never had an issue ;)
Be sure to save your permalinks (Settings > Permalinks) after any slug update.

I actually just built a plugin to address this very issue. It allows you to change the author url to anything at all. It effectively changes the link shown on the posts, and also redirects any old author pages. Can be specified per user or globally.
https://wordpress.org/plugins/wp-custom-author-url/
Hope this helps!

Related

Wordpress pages redirecting to Home page

I have a wordpress website at http://www.wjewel.com/ . All the pages of the website are getting redirected to home page. There is no .htaccess file or web.config file for redirections. Can someone please guide me what could be the reason for this issue.
Resetting the permalinks within WordPress will resolve this issue.
To reset the permalinks for your WordPress installation:
Log into the WordPress Dashboard.
In the side panel, go to Settings > Permalinks.
Make note of the current setting. (If you are using a custom
structure, copy or save the custom structure somewhere.)
Select the Default option.
Click Save Changes.
Now select the previous setting you had before Default was selected.
Click Save Changes.
Redirection is done on client side. You have this meta tag in the html head.
<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.wjewel.com">
(It has nothing to do with PHP headers)
I'd try to look for plugins injecting that meta tag or theme header.
Also just an observation - html body on /about/ page (for example) is empty.
I had this issue today and found that Yoast SEO have a permalinks setting which had two of my pages listed as redirect to home page.
I don't recall myself setting them up, but thankfully there was a button to delete those pages from that list.
Old question but I had the same issue and tried all solutions with no luck. Even deleting htaccess didn't work. I changed my settings to set latest posts as my homepage and then changed it to the desired page and that did the trick (at least for now)
fixed
I had a similar problem.
But only some selected pages were redirecting to home. And these pages which were redirecting worked on page no. permalink setting.
Tried everything as mentioned above, nothing worked.
I cleared my browser cache and it was all good again.

Post content only visible when only logged with admin

Check live- http://mylistoflists.com/9-football-season-snack-ideas/
Post content only visible when i logged with admin, due to my low knowledge on wordpress i am not sure how to fix that.
N: B: Post visibility set as PUBLIC!
Without Admin
With Admin
My guess is that your post is set to Private in the Post settings in the posts tab on your dashboard.
You have to click on edit and then choose public instead.
EDIT:
First Look at your trashcan. If there are posts with the same name it can conflict with the new post. Try to empty your trashcan.
Second: Are you using a cache plugin? Try to disable this and see if that fixes it.
Only Admin can see your code:
<?php if(current_user_can('administrator')): ?>
//put your code part only admin can see
<?php endif; ?>
your problem will solve with one these of solutions:
first check that post published in public mode.
if you have a cach plugin or any speed boost plugin, first deactive that plugin and see that problem resolved or not?
if above solution not work, then deactive all plugins of wordpress and check again,
and also if above solution not work, change your wordpress theme to default theme like twenty seveteen and check that problem solved or not
Deactivate "W3 Super Cache" Plugin or any cache Plugin. It works for me. Hopefully, it will work for you.
DELETE htaccess file, is the only 100% working solution.

Permalink redirect issue in WordPress

My WP website is currently set to use the following permalink structure:
http://websitename.com/%postname%/
If I change that it to:
http://websitename.com/%year%/%monthnum%/%day%/%postname%/
everything works correctly. Specifically, older blog posts posted elsewhere (e.g. my FB page) redirect to the new URL automatically.
However, if I use a custom permalink structure and set it to the following:
http://websitename.com/blog/%postname%/
the redirect does not work on older posts. That is, I can still access all of the posts from the site, but if I linked to one of my blog posts on my Facebook page, for example, the old URL produces a 404 and does not redirect. I am thinking it has something to do with "blog" not being one of the variables that WordPress recognizes.
Any thoughts on why this is happening, and how to fix it?
Thanks in advance!
You can use wordpress quick redirect plugin for redirection
http://wordpress.org/plugins/quick-pagepost-redirect-plugin/
It is simple to use

How to change URL links that were made by WordPress?

I have a WordPress blog. All the post are currently in this convention:
http://www.myblog.com/blog/?p=1442
Now I'd like to change the URL of all posts like this one:
http://www.gomidjets.com/blog/this-is-my-post
While it's quite easy to apply it by changing the blog settings, the big problem is about the links I've placed
in many external website. I can't change them, and I'd like to map the old links to the new links somehow.
Do you know how to do it - if that's possible at all?
Do you have a better solution?
Thank you very much
Wordpress will map all old URL to new one, in case if you provided all URL in their original shape, such as http://example.com/?page_id=80
The answer is: you don't need to do anything.
I believe what you're looking for can be found in the admin panel.
In the admin panel (http://www.your-wordpress-site.com/wp-admin), go to Settings > Permalinks
Login to the admin panel first,
go for the settings->Permalink Settings
Select the format you want.
If you want change the base url for only some posts then you can edit from database.
Try this Redirection wordpress plugin to redirect your old url to your new url.
The URL's should resolve fine because the original URL you're using is the permalink one to my knowledge. If you're wanting end users to be redirected to this url, that's a bit harder.
That aside, I couldn't find any plugins that already did this. What you want to do is check the current URL against the wordpress function get_permalink() and if it doesn't match, redirect to the current permalink URL.

clean urls in wordpress

Im using page.php in wordpress for making a dynamic page.
Right now Im using photography/?cat=portraits
But I want photography/portraits
Im currently grabbing whatever is in my query string (cat=portraits) and only showing that content.
Where at in wordpress can I set up the routes or permalinks to be formated more simple?
Permalinks can be found under the setting tab from your WordPress admin interface
Follow this tutorial...
http://www.creativecitrus.com/wordpress-development/how-to-get-pretty-urls-in-wordpress
Or theres the Pretty URL plugin....but Ive never used that
http://wordpress.org/plugins/pretty-url/
Login wp-admin
Settings -> permalinks and choose custom structure place this sting and save it
/%category%/%postname%
If you have any problem in saving permalink please copy paste it in htaccess.
Or make it write permission for period.

Categories