In Pennsylvania, in the case of children who may be tempted to trespass, landowners could expose themselves to an “attractive nuisance” law suit if there is a structure or scenic resource deemed too attractive to expect no one to be tempted to use your lands. In some cases, people with swimming pools had to erect fences high enough to keep the neighborhood kids from pool hopping and possibly drowning. The general liability principle is as follows: The gravity of the harm in one hand, versus the likelihood of its occurrence plus the cost of prevention. If the gravity of harm is kids could fall down a well, and there is a school house nearby, then a fence may be in order. Be cautious, you only have the right to use reasonable force to protect your property, even in the case of fencing, etc. So don't go overboard with keeping people out either. In short, the law requires you to be reasonable, put people on notice and protect yourself from tempted, underage trespassers.
No legal advice or research upon which one can rely is being provided here. The author assumes all inquiries on Avvo are hypothetical, or too general to give competent advice. The author strongly suggests all serious inquiries be taken to an attorney's office with the intent to hire competent counsel.
Your question asks about trespassers. Pennsylvania law places obligations on the landowner based on the status of the person who "appears" on the land. There are basically 4 categories.
The lowest level of duty is the obligation toward a trespasser. The landowners obligation is simply not to set traps that can harm a trespasser. The landowner is not obligated to warn of hazardous or dangerous conditions, not obligated to look for hazards and not obligated to repair hazards.
The next level of duty is to licensee. A licensee is someone on the land with the knowledge or permission of the landowner but is on the land for their own benefit--think of someone coming to your house for a social visit as opposed to say a worker coming to do repairs. the obligation here is to warn of defects/hazards the landowner knows about. THere is no obligation to go out and look for them or even repair them.
The invitee, especially a business invitee, is owed the highest duty of care of any entrant on land. A business invitte appears on the land for the benefit of the owner. They are owed all the duties mentioned--no traps, warnings, search for hazards and reasonable repairs. The idea is that everything has been done to prepare the land for their presence.
So, a plain old trespasser--someone you do not know is on your land is owed little by way of duty. However, there can be dangers here--if the trespassing is frequent--you may owe more of a duty. For example if you know people trespass because your land is a short cut to get somewhere else you may have more potential liability. A prior answer mentioned "attractive nuisance," that is another way you may be exposed to more potential liability for an injury.
Overall though, a landowner does not have that much exposure for injury to a "real" trespasser.