# Fix published date and author for topics created via wp-discourse-embed plugin

**URL:** <https://meta.discourse.org/t/fix-published-date-and-author-for-topics-created-via-wp-discourse-embed-plugin/49681>\
**Category:** WordPress\
**Tags:** wordpress\
**Created:** [September 3, 2016, 6:48pm UTC](https://meta.discourse.org/t/fix-published-date-and-author-for-topics-created-via-wp-discourse-embed-plugin/49681 "2016-09-03T18:48:42Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)\
**Post date:** [December 16, 2017, 11:52pm UTC](https://meta.discourse.org/t/fix-published-date-and-author-for-topics-created-via-wp-discourse-embed-plugin/49681/4 "2017-12-16T23:52:17Z")

</div>

Hi, I tried your script but removed this part:

```
author_username = raw_doc.at('meta[@name="author"]')
if author_username.present?
  begin
    author = User.where(username_lower: author_username[:content].strip).first
    if author.present? && author.username_lower != topic.user.username_lower
      PostOwnerChanger.new(post_ids: [topic.first_post.id], topic_id: topic.id, new_owner: User.find_by(username_lower: author.username_lower), acting_user: User.find_by(username_lower: "system"), skip_revision: true).change_owner!
    end
  rescue
    # handle error
  end
end

```

Because I only wanted to update the Discourse posts dates.  
The script told me: `61 posts fetched and corrected!` but the dates weren’t changed.

Any idea how to make this work?

---

_[View the full topic](https://meta.discourse.org/t/fix-published-date-and-author-for-topics-created-via-wp-discourse-embed-plugin/49681)._
