Wordpress slug duplicate content parent/child - wordpress

i need some advice what i´m doing wrong
So i have one Page without a parent page attribute called "bar" with slug "bar"
available at
/bar/
then i have child-pages for example "foo" which have the "bar" page as parent attribute and slug is "foo"
available at
/bar/foo/
but also at
/foo/
is this the standard-behaviour of wordpress ?
do i have to make .htaccess rewrite-rules for every single page ?
is there any option i need to check ?
i´m using wordpress 3.6.1

You will find the 'rewrite rule generator' of wordpress in settings / permalinks.
However, if you need more customization, you can do it on a per page / article basis with the edit link located next to the permalink under the page title. Warning: this edit button is only available if you did not choose 'custom structure' in wordpress permalink settings.
If this solution is still limited for you, you can edit the .htaccess of your wordpress site to add your own rewrite rules.

This is the standard behavior of WordPress. Normally permalinks of sub pages contain the slug of its parent page just before the sub page slug. If we try to go for a permalink without the parent page slug it will redirect automatically to the permalink structure with parent page slug.

Related

How to change the "/portfolio" slug from Wordpress?

My wordpress site has a portfolio page by itself, and the link is www.example.com/portfolio. I tried to find the specific page (with this url), but i couldn't find. So my purpose is to create a portfolio page, on my wordpress site and have the specific url "www.example.com/portfolio".
That where i did, to create a portfolio page, was to create a page and change the slug to "www.example.com/portfolio", but when i hit this url, show me the portfolio page, that has the site by itself and not my page.
So my question is, can i change the name of the existing url "/portfolio" and if yes, how (can i change it from my wordpress files), to appear the page i created and not existing page has the site by itself?
Thank you in advance!
Your WordPress page slugs aren't configured from within the codebase; instead if you go to the relevant page whilst in the admin dashboard, on the right hand side will be some config options - here is where you're able to change the slug.
How to change your slugs using permalinks WordPress Docs
It means you have a custom post type "portfolio". You need to unregister it. Put this code in the functions.php file of your active theme and then create a new page with a "portfolio" name(title).
if( !function_exists( 'cus_unregister_post_type' ) ) {
function cus_unregister_post_type(){
unregister_post_type( 'portfolio' );
}
}
add_action('init','cus_unregister_post_type');
Amin panel, go to pages... search for the page portfolio... there is no physical presence like portfolio.php... hope this helps
You just use this plugin and this plugin will help you.
Plugin: https://wordpress.org/plugins/custom-permalinks/

Create WordPress posts with links under /blog

My current set-up results in posts being created under the webroot:
www.domain.com/my-post
www.domain.com/my-other-post
How can I make it so posts are created "under" /blog/:
www.domain.com/blog/my-post
www.domain.com/blog/my-other/post
Editing the permalink results in the / needed being turned into a -.
Is there a setting the force posts under a parent?
Use https://wordpress.org/plugins/custom-permalinks/ plugin and just add blog in url before post name,it will work
As at WordPress 5.2.2, in Settings > Permalinks, in the Common Settings section, the option to set a custom structure for permalinks exists for posts.
The default is set to Plain, which results in /?p=123 style posts. Switching to Custom Structure allows the switch from the default of /%postname% to /blog/%postname%.
My existing posts now live under /blog/ along with newly created ones.
As a side note, if the site is already live then redirects might be needed if you have post links out in the wild.

I cant find the page which is I know permalink in wordpress for editing

I know the permalink: "mysite.com/2017".
But I can't find the page in WordPress.
I create a page. And I was given the permalink "mysite.com/2017" to this page. But WordPress automatically change the permalink to "mysite.com/2017-2"
I used a plugin called List all URLs. But plugin not showed "mysite.com/2017". The page exists but I can't find in WordPress.
My Questions:
Can I force the WordPress for the change the new page permalink to
"mysite.com/2017"?
Or How can find the page "mysite.com/2017" in WordPress for editing
permalink?
Probably you had another version with the same name before, so Wordpress renamed the page slug to "2017-2".
But when you edit the page (calling it from the "All Pages" list in the backend), below the title and next to the permalink there, you can click the "Edit" button to change the permalink of that page to whatever you like.

How to Change the permalink of new posts while keeping the existing permalink for existing posts in wordpress

I want to change the permalink of new posts while keeping the existing permalink for all old posts for a wordpress based blog in order to retain the backlink power and social sharing score. I have searched the whole wordpress plugin directory and found only one plugin called Advanced Permalinks. I tried this plugin but couldn't get the required resutls. It gives 404 error for all previous posts.
Could you any body help me in this regard?
you must set default setting at the beginning and put page id and post id like ?page_id or ?p on the page or post then change the permalink option from setting. Wordpress change permalink at run time from default setting.

.htaccess issue in Wordpress giving 404 on all pages

I have a wordpress multi-site:
site1.local.loc [with subdomains on my local] and I would like to have three pages on this.
site1.local.loc/works - (posts page, but I want 'Works' as my title)
site1.local.loc/about - (static page)
site1.local.loc/contact - (static page)
Since 'Works' is my posts page where I keep putting in content, I changed my permalinks for this site to:
/works/%postname%/
However, when clicking on 'view post' at the end of posting anything, it leads me to a '404' page which means there is a disconnect. This is also the case for viewing any page. Is my .htaccess file faulty?
How do I solve this? Also how do I make all my posts appear in my 'Works' page (as in, how to make that page the posts page?)
Thanks!
Updated: I've found out that I get a 404 for any page that I create for a site in a wordpress network.
You do not have to touch .htaccess file.
Make a custom post type that is called works. All those posts made in that custom post type will have that url that you desire. There is no other way to do it. (even if there is, it must be dirty) That is celanest way, and since wp does it by itself you can expect that nothing will go wrong wnen you update, install plugins, etc.
Create a category called "Works" that would then show all posts added to that category by simply going to /works/ all posts would then be shown as /works/post-name/.
You will need to change the permalink structure to /%category%/%postname%/
Check this in administration
Settings > Permalinks > Post name

Resources