WP appending -2 to the end of my slug

It might not be a Page. WordPress is very picky about slugs sometimes. You might have to dig in the database’s wp_posts table and see what other post exists somewhere with that name – sometimes it can be an odd thing like a Media Library (image) file. Once you find it, if you completely delete … Read more

Duplicate Slugs on multilingual site (with Polylang)

Go on your back-office, and go on Polylang (Languages) Settings. Then, on URL modifications, check if the option “The language is set from the directory name in pretty permalinks” is checked. If not, check it. Then click on Save changes. Now, you should see this option below : “Share slugs Activated” “Allows to share the … Read more

Ultimate get current page’s slug function

There’s no such thing as a single permalink document name. It varies depending on what is being queried. Taxonomy terms use the slug of the term, pages and posts uses the slug of the posts. Post type archives sometimes use the post type name, but they might use something else entirely depending on how it’s … Read more

How to put title slug into content when create a new post?

You have to use the_content filter. Following example is to just adds a featured image set from the single post Edit screen which displays before the content on single posts only. You can change it to display title and permalink. add_filter( ‘the_content’, ‘featured_image_before_content’ ); function featured_image_before_content( $content ) { if ( is_singular(‘post’) && has_post_thumbnail()) { … Read more

can’t change page slug

My first guess would have been that the page was in the Trash, but you’ve said in the OP that it isn’t. So… If you have access to your MySQL database, run this query: SELECT * FROM wp_posts WHERE post_name=”page-title” That will return the post that’s using the slug.