Skip to main content
2 of 2
improved answer

To backup only posts,pages and related media files for 3 week.

You need to do the following:-

  1. Backup Database of website for post/page text.
  2. Backup wp-content\uploads folder for media.

Then you can delete all files and restore old files.Once all old files uploaded then you can upload wp-content\uploads folder of current site.

PS: check uploads and folders in it for any backdoor code.

Edit

Once restoration is done install Anti-Malware WordPress plugin and scan for any malware files in them. It is better plugin.