Question: Google search results:

"posts by categories" — 442 000  

"posts by category" — 2 820 000 

Usually there are many posts and many categories, but many people do something like that: <http://heteconomist.com/all-posts-by-category/> Is it correct?

Answer: 
People who write *by categories* think about posts sorted into a number of categories, people who write *by category* think about *category* as the criterion for sorting. Either form is acceptable, but I think the singular is mildly preferred in formal discourse.
"posts by categories" is incorrect.

"posts by category" assumes multiple categories, else it's meaningless.

One would also say, for example, "posts by gender" not "posts by genders".