最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Strange permalink issue: can't rename company-2 to company

programmeradmin4浏览0评论

I created a page titled company. But the permalink turned it into /company-2/, trying to change it to just /company/ doesn't work. The website just has 8 pages and none is called company (don't know if company as page title is used in the past?).

What can i do and what is the cause? Where should i look? Not afraid to use phpmyadmin ;)

regards

I created a page titled company. But the permalink turned it into /company-2/, trying to change it to just /company/ doesn't work. The website just has 8 pages and none is called company (don't know if company as page title is used in the past?).

What can i do and what is the cause? Where should i look? Not afraid to use phpmyadmin ;)

regards

Share Improve this question asked Mar 6, 2012 at 18:35 alexalex 1,1123 gold badges17 silver badges39 bronze badges 2
  • 1 I can confirm, items in the media library with the same name as your page will cause the numbers to be appended to your page permalink name. – Chris Commented Jun 15, 2017 at 13:47
  • If you are absolutely sure you have no other pages etc with this slug/name, in trash or not, it MIGHT be the Yoast redirect! It was IT in my case and thanks to Kman I solved it! Thanks!! – Roza Commented Jun 17, 2017 at 20:45
Add a comment  | 

7 Answers 7

Reset to default 11

Check the slugs of the other pages - chances are /company/ is being used for one of those. You could also go to /company/ on your site and see if anything pulls up.

As mentioned in a comment, make sure to check the trash as well. You may have deleted a page with that name, but if it is still in the trash you can not reuse the name.

You're close. The permalink cannot be changed because at some point another page titled 'company' was drafted (not necessarily published). Unfortunately, there isn't much that I know of that you can do from WordPress to change this besides naming the page something else. However, you could go into the database if you have access and look in the 'wp_posts' table. Keep searching under the 'post-title' column until you find one that is simply 'company' and delete it. This should, in theory, solve your problem.

I had the same problem and did everything that is normally suggested (empty trash etc)..I found the problem was that I had an image in the gallery with the same name as the page. Deleted the image, uploaded it with a new name and the problem disappeared.

In my case, I was trying to rename /gallery/2010-2/ to /gallery/2010/. This is similar to your case, except I was trying to rename the page slug to a number. This is prohibited by wordpress since numbers are reserved for archive type pages. There may be other restrictions I didn't look them up. Hopefully this helps somebody else who ends up here after searching for "Can't change WP page slug".

I had this problem. And I checked all forums and trash and drafts and images with the same name. In the end I fond the problem with my incorrect usage of Yoast plugin - the redirect section. I created a redirect for a page which did not exist and that blocked me from creating a page with that url. Once I deleted the redirect I was able to rename the slug.

As others have suggested, this looks like a duplicate slug or (post_name) in another WordPress item. Since most every piece of content in WordPress is stored in the posts table (usually wp_posts), the following SQL will help you quickly narrow down which item is causing the problem by returning anything starting with company.

Open up MySql ( phpMyAdmin works ) and enter this in the SQL tab.

SELECT ID, post_title, post_name, post_type 
FROM `wp_posts` 
WHERE post_name LIKE 'company%'
ORDER BY post_name

You've got another post/page with the same slug (probably in your trash) that already has take that. Find it and do your thing with it :)

发布评论

评论列表(0)

  1. 暂无评论