3 Remove irrelevant tags
| link
2 edited tags
| link
source | link

programmatically create posts from files in a folder

I have a folder named 'pdf' (with around 1000 pdf files) in my uploads directory, i would like to create a post for each file in the folder.

I am not trying to import the content from the pdf but simply create a post for each file in that folder.

What i was hoping to achieve:

the posts would get the title from the filename.

the posts would be assigned a single specific category/tag for all the posts.

the post would get the publish date from the file creation date.

I am new to php, wordpress and programming in general, I have a decent understanding of the syntax, loops and functions. I was hoping someone could give me a nudge in the right direction as to what wordpress functions / php loops would be helpful to achieve this. Any thoughts, guidance, information would be a huge help.

Many thanks for your time and help, Sam