Wordpress ignoring custom permalinks structure - wordpress

I have a custom structure for permalinks (Wordpress 3.9.1 + Types 1.5.7) like this:
/%post_id%
But wordpress returns me something like this:
/post-type/%postname%
It seems like wordpress overwrites my post_id param. Any idea?

Try this :
/%post-type%/%postname%/
If that doesn't work check the codex Wordpress codex
I'd also look into using tags, categories, or taxonomies as a possible solution (again, check the codex-I've got no idea)

Related

Permalinks for CustomPostType with CustomTaxonomy in WordPress

Using CPT UI I created a taxonomy "especialidades" and a post type "tab_especialidad" using my new taxonomy "especialidades".
I need the permalinks of the "tab_especialidad" post types like this:
http://webpage.com/especialidades/[taxonomy-slug(especialidades)]/[post-slug(tab_especialidad)]
Is this possible?
I found the solution here: https://wisdmlabs.com/blog/add-taxonomy-term-custom-post-permalinks-wordpress/
With just a small changes in my functions.php it's working :)

Remove 'custom-cpt' from 'custom-cpt/post-title' from custom post types permalinks

Lets say I have this custom post type: 'pt-services'
So, posts will have this kind of urls:
pt-services/post-one
pt-services/post-two
How is it posible to remove pt-services from the urls? So they look like:
/post-one
/post-two
I tried what suggested in here but didn't work...
Any thoughts?

web.com/post/post-title redirects to web.com/post-title

I'm having a complain of the SEO guy because a post url is not like this
web.com/blog/post-title
But like this
web.com/post-title
And even web.com/blog/post-title redirects to web.com/post-title
How could I restore normal behavior? it looks like they are being treated as page but they work as posts in web.com/blog
Go to Settings -> Permalink
Choose the Custom structure and fill the value with /blog/%postname%/
Need to update the htaccess inorder to get the old path works OR you can set the permalink is to /blog/%postname%/ like this
Please refer this link:
https://wordpress.stackexchange.com/questions/19238/how-do-i-add-blog-as-a-prefix-to-permalink-structure-for-blog-posts-tag-pages

WP Rewrite - Add post ID to URL

I have a custom post type (job) in my WordPress theme.
Posts of this type are inserted by users themselves, but if two or more jobs are inserted with the same title, the slug will be:
www.mydomain.com/job/title-choosen-by-user
www.mydomain.com/job/title-choosen-by-user-2
www.mydomain.com/job/title-choosen-by-user-3
...
Is it possible to keep the same slug and add the post ID in the URL using any rewrite? The result would be:
www.mydomain.com/job/100/title-choosen-by-user
www.mydomain.com/job/101/title-choosen-by-user
www.mydomain.com/job/102/title-choosen-by-user
...
Any help would be appreciated.
Thank you
Perhaps try changing your permalink structure in Settings > Permalinks under the WP admin dashboard.
Try:
/%post_id%/%postname%/
Ok I found a small but working tutorial for custom permalinks structure
http://shibashake.com/wordpress-theme/custom-post-type-permalinks-part-2

Rewrite category wordpress

Is it possible to rewrite only one category ?
I have a category "Photos" and just for this category.
I just want to rewrite it from /category/photos to /photos
You can do it with WP Rewrite API.
Add this to functions.php
add_action('init', 'register_rewrites');
function register_rewrites() {
add_rewrite_rule('^photos$', 'index.php?category_name=photos','top');
}
Remember to reload your rewrite settings: go to Settings -> Permalinks and click on Save button - no changes needed.
The Yoast SEO plugin has this function build in, I recommend this plugin in general.
no-category-base-wpml only does this
If you don't want to install a plugin for this. Around the web there are many tutorials which do this:
http://thisismyurl.com/6704/remove-category-url-wordpress/
http://www.webdevtuts.net/php/how-to-remove-category-from-wordpress-url-structure/
http://www.wprecipes.com/how-to-remove-category-from-your-wordpress-url
Too enable this for just one category I would advise the following:
create a page called photos.
create a theme template page for this photo page
In is set up a new query_posts* getting the category 'photos'
Include the category.php file.
assign that template to the photo page.
Not tested but should work. Because the page has the correct URL and should include the category. Questions, aks.
*query_posts is bad for performance if you want to do it totally correct use the pre_get_posts filter. It's requires more knowledge.

Resources