Existing relationships for lateral backfill pressures on pipelines assume that the trench is adequately wide to contain the failure surface. This condition is commonly violated in design and construction practice, putting at risk the pipeline safety. In this context, size and shape effects for trenches excavated in stiff soils and rocks, are numerically investigated, through experimentally-calibrated parametric analyses. It is shown that, for narrow trenches, ultimate pressures and yield displacements may increase up to an order of magnitude compared to “infinite-trench” values, while excavation of inclined walls reduces the above detrimental effects. Simplified relations are developed to aid pipeline design.