Yes, experts generally recommend those with reduced kidney function avoid nonsteroidal anti-inflammatory drugs such as ibuprofen or naproxen. This is because they can harm the kidneys.
Additionally, because aspirin can increase the risk of bleeding, anyone with reduced kidney health should consult a doctor before taking it.
A person with kidney problems should talk with a doctor before taking any OTC pain medications.