Recent advances in understanding of sediment material properties and of burrowing mechanics suggest likely differences in the behavior of organisms burrowing in mud and sand. The path of least resistance in the mud may lead an infaunal organism to burrow along a rigid wall. By contrast, in sand, force chains may prevent a burrowing organism from reaching a rigid wall. Burrowing in mud occurs primarily by the propagation of cracks. Cracks, and hence burrows, tend to propagate along rigid walls. In sand, force chains comprise collections of particles that experience much more stress than their neighbors. Stress chains tend to terminate at walls where their high density may inhibit burrowing. To test for differing effects of mud and sand on the spatial distribution of infauna, proximity to a rigid wall of two polychaetes, Alitta virens and Clymenella torquata, was measured in sand and mud. For both species the cumulative density distribution of burrow distances from the wall showed significantly more burrows near the wall than expected in both mud and sand. However, in direct sampling experiments, the more mobile A. virens showed a greater tendency to burrow at the wall in mud than in sand and strong exclusion from the immediate vicinity of the wall in sand, whereas C. torquata did not show a significant difference in distance from the wall in sand versus mud. The wall effect may be weaker for C. torquata because its limited mobility makes it less likely to encounter a wall over the course of an experiment. Our results point to the need for quantitative assessment of biases of analytical devices that rely on rigid walls, such as optodes and sediment profile imaging cameras, and suggest a possible similar bias in animal distributions around natural analogs such as rock-sediment boundaries.