Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have pretty permalinks enabled like this:

http://domain.com/category/post_name

I also use facebook comments widget for the comments, Currently the href attribute is set to the pretty permalink by calling the_permalink().

The issue is that if i ever happen to edit the post name (slug) or the category, Facebook thinks it's a new URL so the old comments are not displayed anymore.

I tried fixing the issue by pointing the href to the non-pretty permalink like: http://domain.com/?p=XXX but now Facebook shows a warning that it can't reach the URL, that's because WP redirects non-pretty urls to pretty with a 301 redirect.

Any idea how to work around this?

share|improve this question

1 Answer 1

I hate to say it, but the answer is to not edit the post slug or category.

Yes, you can edit the post name ... but leave the slug alone. Remember, other people (users, Google, etc.) use these URLs as well, so changing the URL of a post around makes them think it's a new URL, too.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.