In 1975, Erdős proposed the problem of determining the maximal number of edges in a graph on \( n \) vertices that contains no triangles or squares. In this paper, we consider a generalized version of the problem, i.e., what is the maximum size, \( ex(n; t) \), of a graph of order \( n \) and girth at least \( t+1 \) (containing no cycles of length less than \( t+1 \)). The set of those extremal \( C_t \)-free graphs is denoted by \( EX(n; t) \). We consider the problem on special types of graphs, such as pseudotrees, cacti, graphs lying in a square grid, Halin, generalized Halin, and planar graphs. We give the extremal cases, some constructions, and we use these results to obtain general lower bounds for the problem in the general case.